On Jan 18, 2008 1:46 AM, Michael S. Fischer <michael at dynamine.net>
wrote:
> On Jan 17, 2008 10:18 PM, Francis Cianfrocca <garbagecat10 at
gmail.com>
> wrote:
> > > Is getsockname (or its equivalent) available to an EM Connection
> > > object? I''d like to access the local port number in my
client
> > > application.
>
> > No, it''s not. I can patch it in quickly if you don''t
have a workaround.
>
> I''d appreciate it...
>
>
>
EM::Connection#get_sockname added. Sync to HEAD, in trunk. Please let me
know if it''s what you needed. Sample code:
require ''rubygems''
require ''eventmachine''
require ''socket''
module A
def connection_completed
p Socket::unpack_sockaddr_in( get_peername )
p Socket::unpack_sockaddr_in( get_sockname )
end
EM.run {
EM.connect "www.rubyeventmachine.com", 80, A
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://rubyforge.org/pipermail/eventmachine-talk/attachments/20080118/6abe7b4d/attachment-0001.html