server
#include <glib.h>
#include <gio/gio.h>
#include <stdio.h>
gchar *buffer;
gboolean network_read(GIOChannel *source,
GIOCondition cond,
gpointer data)
{
GError *error=NULL;
gsize len;
GString *s = g_string_new(NULL);
const gchar *msg = "The price of greatness is responsibility.";
GIOStatus ret = g_io_channel_read_line_string(source, s, NULL, &error);
if (ret == G_IO_STATUS_ERROR){
g_error ("Error reading: %s\n", error->message);
g_object_unref(data);
return FALSE;
}
else if (ret == G_IO_STATUS_EOF) {
g_print("finished\n");
return FALSE;
}
else {
g_print("Got: %s\n", s