[Nice] patch: nice_agent_get_selected_socket

Olivier Crête olivier.crete at collabora.com
Thu Nov 14 14:10:58 PST 2013


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

More information about the nice mailing list