[libnice] [Nice] Help sending data in reliable mode
Marco Fantasia
fantasia.marco at gmail.com
Tue Apr 14 03:37:24 PDT 2015
Hi Philip,
I've extended my tests on these day, read all the test files in /test dir and I
think I come in a solution for sending file through sockets in reliable mode. I
based my code on test-send-recv.c file.
Here it is what my code does:
It gets ICE candidates in SDP-way, showing the encoded64 sdp like the sdp-
example in /example dir.
If the node is the controlling one, a write thread is created and then after
established a reliable connection guaranted by stream_ready mutex, the
encoded-64 file is sent on the stream socket.
If the node is the controlled one, a read thread is created and after
established a reliable connection is waiting for receinving the file with
expected dimension.
I tested the code in a local envoirement and in a real case scenario and I
think I got think ordered.
Tested my code on OpenSuse and Ubuntu.
To compile the code you can exec these commands:
gcc -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -
I/usr/local/include/nice -I/usr/local/include -O0 -g3 -Wall -c -fmessage-
length=0 -pthread -MMD -MP -MF"TestPseudoTcpFileTransfer.d" -
MT"TestPseudoTcpFileTransfer.d" -o "TestPseudoTcpFileTransfer.o"
"TestPseudoTcpFileTransfer.c"
and then link with
gcc -L/usr/local/lib64 -o "TestPseudoTcpFileTransfer"
TestPseudoTcpFileTransfer.o -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lnice
I hope this will help,
Marco
In data martedì 14 aprile 2015 10:41:46, Philip Withnall ha scritto:
> Hi,
>
> On Thu, 2015-03-12 at 17:12 +0100, Marco Fantasia wrote:
> > I'm currenting writing a project in which two nodes communicate each
> > other and the controlling agent sends data to the other one.
> > I've implementing my communication structure using XMPP and I'm able
> > to let my nodes communicate.
> > You can find my project on GitHub:
> > https://github.com/marcoxsurf/NiceStrophe/
> > Now I have to let the controlling node to share a file to the
> > controlled one. I have followed this discussion
> > http://lists.freedesktop.org/archives/nice/2012-September/000633.html
> > but I have still problems.
>
> > Here it is the code that I'm testing:
> Sorry, to be blunt, this is far too complex to expect people on a
> mailing list to try and compile, test and debug for you.
>
> If you can provide a minimal test case which reproduces your problem,
> along with clear instructions for compiling it and reproducing the
> problem, then people might be able to spend time investigating your
> problem and helping you.
>
> Sorry,
> Philip
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TestPseudoTcpFileTransfer.c.tar.gz
Type: application/x-compressed-tar
Size: 4977 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/nice/attachments/20150414/05338db0/attachment.bin>
More information about the nice
mailing list