From: Bill Cunningham on
When writing a client socket am I correct in saying that socket() and
connect() are all that is needed? Of course fcntl() can be used and I use
O_NONBLOCK and not O_ASYCH so my linux is unix compatible for others and my
solaris.

Bill


From: Dmitry V. Krivenok on
On Jul 5, 12:08 am, "Bill Cunningham" <nos...(a)nspam.invalid> wrote:
>     When writing a client socket am I correct in saying that socket() and
> connect() are all that is needed? Of course fcntl() can be used and I use
> O_NONBLOCK and not O_ASYCH so my linux is unix compatible for others and my
> solaris.
>
> Bill

That's usually enough if ephemeral ports are okay to you.
However, you _may_ also call bind() before calling connect().
From: Bill Cunningham on
Dmitry V. Krivenok wrote:

> That's usually enough if ephemeral ports are okay to you.
> However, you _may_ also call bind() before calling connect().

Ok thanks


From: Emacs on
On Jul 5, 4:08 am, "Bill Cunningham" <nos...(a)nspam.invalid> wrote:
>     When writing a client socket am I correct in saying that socket() and
> connect() are all that is needed? Of course fcntl() can be used and I use
> O_NONBLOCK and not O_ASYCH so my linux is unix compatible for others and my
> solaris.
>
> Bill

With TCP, it is usually enough , and sometimes you maybe need to call
bind() if you want to bind to some specific ip address and port
However, with UDP, first use socket() and then call sendto() or
recvfrom()