Re: OTBind and bind
Re: OTBind and bind
- Subject: Re: OTBind and bind
- From: Mark Thomas <email@hidden>
- Date: Wed, 20 Oct 2004 18:12:08 +0100
- Organization: Coderus Ltd
Sorry my mistake, I still needed to ::bind with no port specified to be
given any available port, where then I can do a getsockname on it.
Although onto my next question I need to do some some DGRAM packets, and
have created the UDP socket, and set the broadcast flag, but what I'm
looking for now if the BSD equivalent OTSndUData and OTRcvUData. I'm being
to think its sendto and recvfrom are the equivalents. What I'm not sure
about is what are the "struct sockaddr" parameters will be used for ???.
I guess on the recvfrom it will who send me this DGRAM ???, but on the
sendto I'm not sure, or is this the equivalent of the TUnitData addr field
here.
Thanks for any insights,
Mark.
----------------------------------------------------------------------
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