Revision bd5605dd
Added by Hamish Coleman over 16 years ago
- ID bd5605dd532b0e6d3ca1e6fc996974cc73243494
wconsd.c | ||
---|---|---|
|
||
struct sockaddr_in sa;
|
||
int salen;
|
||
char buf[MAXLEN];
|
||
|
||
int i;
|
||
|
||
... | ... | |
wait_array[2]=connectionCloseEvent;
|
||
|
||
while (run) {
|
||
dprintf(1,"wconsd: top of wconsd_main run loop\n");
|
||
|
||
o=WaitForMultipleObjects(3,wait_array,FALSE,INFINITE);
|
||
|
||
switch (o-WAIT_OBJECT_0) {
|
||
... | ... | |
break;
|
||
}
|
||
|
||
dprintf(1,"wconsd: new connection from %08x\n",
|
||
if (!getnameinfo(&sa,salen,&buf,sizeof(buf),NULL,0,0)) {
|
||
dprintf(1,"wconsd: new connection from %08x\n",
|
||
htonl(sa.sin_addr.s_addr));
|
||
} else {
|
||
dprintf(1,"wconsd: new connection from %s\n",
|
||
&buf);
|
||
}
|
||
|
||
/* search for an empty connection slot */
|
||
i=0;
|
Also available in: Unified diff
Try using getnameinfo to show more information about connected users