Re: OTBind and bind
Re: OTBind and bind
- Subject: Re: OTBind and bind
- From: Vincent Lubet <email@hidden>
- Date: Wed, 20 Oct 2004 10:12:38 -0700
getsockname() is really what you need. Of course you need first to call
bind() to get a port assign to the socket. If you pass 0 for the port
in the sockaddr_in structure, the kernel will assign an ephemeral port
to the socket.
Vincent
On Oct 20, 2004, at 8:58 AM, Mark Thomas wrote:
This isn't quite what I need as I need to get the portname before the
socket
is actually connect up or used in UDP transfer. I.e. In the similar way
OTBind 2nd parameter does before you do a OTConnect or a OTSndUData
As this does return the portname presently assigned, which works fine
if
already been used, but I need to get before. How does OT do this ???.
Thanks
Mark.
On Oct 20, 2004, at 4:47 AM, Mark Thomas wrote:
Migrating the code over to BSD sockets, is there a way to get what
socket
number a particular BSD socket is using or will use ???. As with
OTBind you
can find this out, any ideas how it does this ???.
Use the getsockname system call to retrieve the address bound to the
socket.
Vincent
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden