[cmd.client] fixed standard inverted output/input

This commit is contained in:
xdrm-brackets 2018-04-24 23:42:42 +02:00
parent 39c9d8169f
commit 4574bf7d0c
1 changed files with 7 additions and 7 deletions

View File

@ -45,11 +45,11 @@ func main(){
---------------------------------------------------------*/ ---------------------------------------------------------*/
/* (1) Create context */ /* (1) Create context */
ctx, err := context.Create( float64(*winSize) / 1e3, uint16(*minDepth), uint16(*thrDepth), uint16(*maxDepth) ); ctx, err := context.Create( float64(*winSize) / 1e3, uint16(*minDepth), uint16(*thrDepth), uint16(*maxDepth) );
if err != nil { os.Stderr.WriteString( fmt.Sprintf("[ERROR:context] %s\n", err) ); return } if err != nil { os.Stderr.WriteString( fmt.Sprintf("[CLIENT_ERROR:context] %s\n", err) ); return }
/* (2) Create client */ /* (2) Create client */
cli, err := client.New(ctx, *clientConfigPath) cli, err := client.New(ctx, *clientConfigPath)
if err != nil { os.Stderr.WriteString( fmt.Sprintf("[ERROR:client] %s\n", err) ); return } if err != nil { os.Stderr.WriteString( fmt.Sprintf("[CLIENT_ERROR:client] %s\n", err) ); return }
@ -62,14 +62,14 @@ func main(){
/* (2) If request */ /* (2) If request */
} else if *isRequest { } else if *isRequest {
err = cli.Send(os.Stdin) err = cli.Send(os.Stdout)
if err != nil { os.Stderr.WriteString( fmt.Sprintf("[ERROR:request] %s\n", err) ) } if err != nil { os.Stderr.WriteString( fmt.Sprintf("[CLIENT_ERROR:request] %s\n", err) ) }
/* (3) If response */ /* (3) If response */
} else if *isResponse { } else if *isResponse {
err = cli.Receive(os.Stdout) err = cli.Receive(os.Stdin)
if err != nil { os.Stderr.WriteString( fmt.Sprintf("[ERROR:response] %s\n", err) ); return } if err != nil { os.Stderr.WriteString( fmt.Sprintf("[CLIENT_ERROR:response] %s\n", err) ); return }
/* (4) Else -> nothing */ /* (4) Else -> nothing */
}else { }else {
@ -101,7 +101,7 @@ func synchronisationRequest(cli *client.T){
/* (1) Get synchronisation key */ /* (1) Get synchronisation key */
syncKey, err := cli.SynchronisationKey() syncKey, err := cli.SynchronisationKey()
if err != nil { fmt.Errorf("[ERROR:syncKey] %s\n", err); return } if err != nil { fmt.Errorf("[CLIENT_ERROR:syncKey] %s\n", err); return }
/* (2) Print synchronisation key */ /* (2) Print synchronisation key */
os.Stdout.Write(syncKey) os.Stdout.Write(syncKey)