diff options
Diffstat (limited to 'instr-client.c')
-rw-r--r-- | instr-client.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/instr-client.c b/instr-client.c index a091d4e..c894bee 100644 --- a/instr-client.c +++ b/instr-client.c @@ -72,12 +72,13 @@ stdinAvailable (GIOChannel *source, GIOCondition condition, gpointer data) if (g_pollable_output_stream_is_writable(out) == FALSE) { g_print("stream is not writable\n"); } - + GError* error = NULL; - + written = g_pollable_output_stream_write_nonblocking(out, tmp, size, NULL, &error); - if(error != NULL && error->message) + if(error != NULL && error->message) { g_print("Got error: %s\n", error->message); + } if (written != size || written <= 0) { g_print("Could not write. blocking. Written: %d\n", written); @@ -96,7 +97,7 @@ static gboolean cbServerInput(gpointer data, gpointer additional) GPollableInputStream* inStream = (GPollableInputStream*)data; GError *error = NULL; - + size=g_pollable_input_stream_read_nonblocking(inStream, buffer, BUFSIZE, NULL, &error); if(size <=0) { terminate("Connection to server lost", -1); @@ -118,7 +119,7 @@ int main(int argc, char** argv) GError* error = NULL; GIOChannel* stdinChannel = NULL; client = g_socket_client_new(); - + /* connect to the host */ connection = g_socket_client_connect_to_host (client, (gchar*)"localhost", |