[Nice] Sending data but not receiving the last part.

Andrés Suero kaneda.uy at gmail.com
Tue Sep 11 19:09:34 PDT 2012


Hello,
I'm having problems with the send of a file, I get almost all the file
(~185KB), but at the end I don receive the last part,
I'm using a reliable agent to transfer the file, the sender send all the
pieces, but the receiver don't get the last part, can it be because I have
some info in some buffer in the agent that I need to flush (in this case,
how I do the flush) or may be because other issue?

void cb_nice_recv (NiceAgent * agent, guint stream_id, guint component_id,
guint len, gchar * buf, gpointer user_data) {
  signal_data *dta = (signal_data *) user_data;
  GError *error = NULL;
  gsize bytes_written;
  int sent=0;
  GIOStatus status;
  do{
    status=g_io_channel_write_chars(dta->channel, buf+sent, len,
&bytes_written, &error);
    if ((status== G_IO_STATUS_NORMAL) && (len>0) && (bytes_written>0)){

      len-=bytes_written;
      sent+=bytes_written;
    }
  }while((status== G_IO_STATUS_NORMAL) && (len>0) && (bytes_written>0));
  if (status!= G_IO_STATUS_NORMAL)
    printf("status distinct of G_IO_STATUS_NORMAL\n");
}

We receive all the info and sent it to the channel, but the las info is not
present.

We are doing an unref ("g_object_unref(data->agent);") of the agent in the
sender, but the agent in the receiver side don't change state,
nor NICE_COMPONENT_STATE_FAILED or NICE_COMPONENT_STATE_DISCONNECTED.

Thanks in advance,
Andrés and Federico
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/nice/attachments/20120911/4f648d42/attachment.html>


More information about the nice mailing list