\nint getsockname(\n SOCKET s, \n struct sockaddr FAR *name, \n int FAR *namelen \n);\n\n(The above taken from the WinSock documentation)
A SOCKET is a "handle" to a socket object. How this "handle" is implemented is implementation-dependent, but on Windoze platforms, handles are defined as pointers. Indeed, the definition of a SOCKET in winsock.h is:
\ntypedef UINT_PTR SOCKET;\n
UINT_PTRis a pointer to an unsigned int.
So what you're doing is implicitly casting an
intto a pointer type, and the compiler is (rightly) bitching about it.
To fix it, define the parameter
fas type SOCKET instead of type int, or explicitly cast f to the SOCKET type.
(NOTE: I don't give a flying shit if these yahoos are from the mighty MIT, passing a socket handle as an
intinstead of as a
SOCKETis really bad coding!. If this is what MIT is pumping out, then it's no wonder why the Indians are eating our lunch!)