version 1.26, 2001/06/26 21:57:35 |
version 1.27, 2001/06/26 23:06:53 |
|
|
|
|
if (lflag) { |
if (lflag) { |
int connfd; |
int connfd; |
|
|
if ((s = local_listen(host, uport, hints)) < 0) |
|
errx(1, NULL); |
|
|
|
ret = 0; |
ret = 0; |
|
|
/* Allow only one connection at a time, but stay alive */ |
/* Allow only one connection at a time, but stay alive */ |
for (;;) { |
for (;;) { |
|
if ((s = local_listen(host, uport, hints)) < 0) |
|
errx(1, NULL); |
/* |
/* |
* For UDP, we will use recvfrom() initially |
* For UDP, we will use recvfrom() initially |
* to wait for a caller, then use the regular |
* to wait for a caller, then use the regular |
|
|
|
|
readwrite(connfd); |
readwrite(connfd); |
close(connfd); |
close(connfd); |
|
close(s); |
|
|
if (!kflag) |
if (!kflag) |
break; |
break; |
} |
} |