[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Does luasocket support unix domain socket UDP?
- From: Francisco Olarte <folarte@...>
- Date: Tue, 31 Mar 2020 13:14:53 +0200
On Tue, Mar 31, 2020 at 9:55 AM Sean Conner <firstname.lastname@example.org> wrote:
> To clarify things a bit , you create either a SOCK_STREAM or SOCK_DGRAM
> , then bind it to an address.
I may be getting it wrong, but I think you create a socket of a family
( AF_INET, AF_UNIX ) and a type ( SOCK_STREAM, SOCK_DGRAM ), then
bind it (or connect) to an address of the same family ( actually,
IIRC, bind is always optional in TCP, you can just connect and let the
system pick a local address ( the usual on outgoing connections), bind
to a local address and then (try to) connect, bind to a known local
address and listen to remote connections ( the usual ) or just listen
and let the system pick a free transport address ( typically a port
and any address) for you ( which you'll need to communicate somehow to
the remote side, but has its uses ).
I'm disgressing. What I wanted to point is bind/listen/connect do not
select the socket type, they also select the family ( unix/ip) and
bind is constrained by the socket.