I have a problem with GIO. I am transmitting data over a network and it works perfectly for a percentage of bytes received (changed via STRINGSIZE) but after that it copies nothing. For Example if STRINGSIZE is 350 it only copies over 50 bytes. Any ideas?
gboolean recieve_complete(GSocketService *socket, GSocketConnection *connection, GObject *source_object, gpointer user_data){
GInputStream * input;
int i;
int *recieved_data = malloc(sizeof(int) * (STRINGSIZE + 50));
for(i = 0; i < (STRINGSIZE + 50); i++)
recieved_data[i] = 0; //Sets register to empty.
input = g_io_stream_get_input_stream(G_IO_STREAM(connection));
g_input_stream_read (input, recieved_data, (STRINGSIZE + 50), NULL, NULL);
proccess_data(recieved_data);
free(recieved_data);
}