Re: [Dev-C++] Dev-cpp-users Digest, Vol 16, Issue 12
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: angel d. <sci...@ho...> - 2007-10-02 23:40:33
|
=20
Any body knows how to use:
=20
getpeername() function on dev-cpp???
=20
I tried it and WSAGetLastError() always return to 10014.
=20
10014 is:=20
Bad address.=20
The system detected an invalid pointer address in attempting to use a point=
er argument of a call. This error occurs if an application passes an invali=
d pointer value, or if the length of the buffer is too small. For instance,=
if the length of an argument, which is a sockaddr structure, is smaller th=
an the sizeof(sockaddr).
=20
=20
This is my function:
=20
void Y_YGetPeerName(SOCKET Client){ LPSOCKADDR Infobuf; int Buf =3D=
sizeof(SOCKADDR); if(getpeername(Client,Infobuf,&Buf) !=3D 0) { cout=
<<"GetPeerName Error"<<endl; } else { cout<<"GetPeerName Success"<<en=
dl; } cout<<WSAGetLastError();}
_________________________________________________________________
Climb to the top of the charts!=A0 Play Star Shuffle:=A0 the word scramble =
challenge with star power.
http://club.live.com/star_shuffle.aspx?icid=3Dstarshuffle_wlmailtextlink_oc=
t=
|