Is there a way to get the active connection socket handle?

I would like to be able to send raw messages from my dll via sockets but use the existing connection rather than create a new one.