Home > Software engineering >  Why get client IP for 0.0.0.0 in GetAcceptExSockAddrs
Why get client IP for 0.0.0.0 in GetAcceptExSockAddrs

Time:03-11


 
.
Case ClientIoAccept:

SOCKADDR_IN * clientAddr=NULL;
SOCKADDR_IN * localAddr=NULL;
Int remoteLen=sizeof (SOCKADDR_IN), localLen=sizeof (SOCKADDR_IN);
LpPerSocketContext - & gt; FnGetAcceptExSockAddrs (
LpIOContext - & gt; Wsabuf buf,
LpIOContext - & gt; Wsabuf. Len - ((sizeof (SOCKADDR_IN) + 16) * 2),
Sizeof (SOCKADDR_IN) + 16,
Sizeof (SOCKADDR_IN) + 16,
(LPSOCKADDR *) & amp; LocalAddr,
& LocalLen,
(LPSOCKADDR *) & amp; ClientAddr,
& RemoteLen);
Char * clientIPStr=inet_ntoa (clientAddr - & gt; Sin_addr);
Int clientPortStr=ntohs (clientAddr - & gt; Sin_port);
.

CodePudding user response:

https://blog.csdn.net/xxxluozhen/article/details/6008864 ?

CodePudding user response:

No understand, I give what went wrong in the code,
  • Related