[Nice] integrating nice to another project

Youness Alaoui youness.alaoui at collabora.co.uk
Tue May 22 17:54:04 PDT 2012


Libnice is indeed thread safe, but you have no reason to be using a thread.
Libnice also requires you to be running the mainloop, otherwise it won't work,
so make sure to run the mainloop, as for your socket, just add a GSource on a
g_io_channel on your socket.

On 05/20/2012 04:28 PM, Andrés Suero wrote:
> Youness,
> Thanks for your response, what we have is a socket that bring us the information, then we transfer peer to peer with libnice, and another socket where we need to put the info that we receive from the peer to peer connection.
> The issue is that the info that we need to transfer to the other peer is not given all in one call, we need to check is theres info in the socket time to time to see if theres more, and if it is, we need to send it.
> Is there a way to add a signal to be called in some period of time in the future, so we can check if we have new info to transmit, or some other way to get this effect?
> The other (complicated) way that I thought was to start a thread when we receive the READY state and within this thread call to receive data from the socket and call to sendit peer to peer, but I don't know if this is going to crash all over the place because the call to the libnice to send is going to be from another thread.
> 
> Another question, Is there a way to attach a function to a signal with a context? this way I don't need to have a lot of global variables.
> 
> Attached is an example of our code.
> 
> Thanks,
> Andrés Suero.
> 
> 
> 
> 
> On 5/19/2012 5:16 PM, Youness Alaoui wrote:
>> Hi,
>>
>> I'm not exactly sure why you're doing this, libnice is meant to create peer to
>> peer connections, it's not meant to be used on a server that proxies data
>> between two peers.
>> Either way, no, the component_state_changed only gets fired when the state of
>> the agent changes, so once it goes into READY, it won't get fired again. You
>> should start your own proxying system only after the state goes to READY.
>>
>> Hope that helps,
>> Youness
>>
>> On 05/18/2012 11:08 PM, Federico Kouyoumdjian wrote:
>>> We are trying to integrate nice to another project.
>>>
>>> We have a socket in which we read data when the state of nice is
>>> NICE_COMPONENT_STATE_READY. Then we send the data read in the socket to another
>>> nice agent with the function nice_agent_send.
>>>
>>> Our doubt is what happens if no data is available in the sockt to send. If we
>>> don't call the function nice_agent_send (because there is no data available to
>>> send) can we count that cb_component_state_changed will fire again with the
>>> state NICE_COMPONENT_STATE_READY.
>>>
>>> Thanks for the help.
>>> _______________________________________________
>>> nice mailing list
>>> nice at lists.freedesktop.org
>>> http://lists.freedesktop.org/mailman/listinfo/nice
>>
>>
>> _______________________________________________
>> nice mailing list
>> nice at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/nice
> 
> 
> _______________________________________________
> nice mailing list
> nice at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/nice


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 262 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freedesktop.org/archives/nice/attachments/20120522/5b25930c/attachment.pgp>


More information about the nice mailing list