相关文章推荐
儒雅的遥控器  ·  reactor netty access ...·  2 年前    · 
鬼畜的杨桃  ·  Qt 之保持 GUI ...·  2 年前    · 
严肃的蜡烛  ·  ubuntu ...·  2 年前    · 
struct sockaddr_in s;
int len = sizeof(s);
int nRes = getpeername(perIoContext->sClient, (struct sockaddr FAR *)&s,&len);
if(nRes == SOCKET_ERROR)
{
cout << "获取错误" << endl;
}
else
{
cout << inet_ntoa(s.sin_addr) << s.sin_port << endl;
}