Revision 9009,
571 bytes
checked in by ghudson, 28 years ago
(diff) |
This commit was generated by cvs2svn to compensate for changes in r9008,
which included commits to RCS files with non-trunk default branches.
|
Line | |
---|
1 | #!./perl |
---|
2 | |
---|
3 | $pat = 'S n C4 x8'; |
---|
4 | $inet = 2; |
---|
5 | $echo = 7; |
---|
6 | $smtp = 25; |
---|
7 | $nntp = 119; |
---|
8 | |
---|
9 | $this = pack($pat,$inet,2345, 0,0,0,0); |
---|
10 | select(NS); $| = 1; select(stdout); |
---|
11 | |
---|
12 | if (socket(S,2,1,6)) { print "socket ok\n"; } else { die $!; } |
---|
13 | if (bind(S,$this)) { print "bind ok\n"; } else { die $!; } |
---|
14 | if (listen(S,5)) { print "listen ok\n"; } else { die $!; } |
---|
15 | for (;;) { |
---|
16 | print "Listening again\n"; |
---|
17 | if ($addr = accept(NS,S)) { print "accept ok\n"; } else { die $!; } |
---|
18 | |
---|
19 | @ary = unpack($pat,$addr); |
---|
20 | $, = ' '; |
---|
21 | print @ary; print "\n"; |
---|
22 | |
---|
23 | while (<NS>) { |
---|
24 | print; |
---|
25 | print NS; |
---|
26 | } |
---|
27 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.