[Nice] patch: nice_agent_get_selected_socket

Rohan Garg rohan16garg at gmail.com
Sat Nov 16 14:31:06 PST 2013

Patch looks good ( apart from the comments from Olivier ). Maybe also
add a unit test to make sure this doesn't break in the future?

Rohan Garg

On Thu, Nov 14, 2013 at 11:10 PM, Olivier Crête
<olivier.crete at collabora.com> wrote:
> Hi,
> On Thu, 2013-11-14 at 15:33 -0600, Bryce Allen wrote:
>> The attached patch adds a function exposing the underlying socket, which
>> allows us to duplicate the socket before destroying the nice
>> agent. We've tested this and it avoids triggering the firewall prompt. I
>> think it could be useful for other users integrating with legacy
>> applications.
>> In our case we use the fileno field of GSocket to get the underlying
>> handle, then use dup/WSADuplicateSocket. Exposing the GSocket seems
>> like the right level of abstraction though. I guess another option
>> would be to make NiceSocket public, then users can cast
>> NiceCandidate.sockptr to NiceSocket and use it to get GSocket etc.
>> Thoughts?
> I also think returning a GSocket is the right level.
> I think you're not the first one to want this. One question, why do you
> just not return a GSocket * or NULL instead of having a separate boolean
> and GSocket** ?
> --
> Olivier Crête
> olivier.crete at collabora.com
> _______________________________________________
> nice mailing list
> nice at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/nice

More information about the nice mailing list