Re: [Dev-C++] Socket Programming - Newbie - sockaddr 16 bytes?
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: <sa...@op...> - 2004-11-06 23:13:03
|
> Obi wrote: > >> m_listenSocket = socket( AF_INET, SOCK_STREAM, 0 ); > > > This is not right. Never call socket() with an AF_ argument; it should > be PF_ (PF_INET in this case). AF_INET just "works" here by coincidence, > because most of the BSD-sockets implementations use the same value for > them. This is just as correct as using "socket(2, 1, 0);". > This is not exactly true. The BSD standard says that the AF_ value will be the same as PF_ value (this could be found on linux man pages). But you are right, the value should be PF_INET because it describes the protocol family not the address family. --- Krzysztof Kapuscik |