diff options
author | Mark Murray <markm@FreeBSD.org> | 1999-05-02 14:33:17 +0000 |
---|---|---|
committer | Mark Murray <markm@FreeBSD.org> | 1999-05-02 14:33:17 +0000 |
commit | ef0775c4f054d9bcacbc3f94478687691d11226b (patch) | |
tree | 6ba8453a691190ab1f96748cae95df2e54cb3c2c /contrib/perl5/eg/server | |
parent | 0feb57945e44edd6419789b4f64868d2937bc553 (diff) | |
parent | 7c312e6b6a7b1f9412f10365baf3c5eca8fa5649 (diff) |
This commit was generated by cvs2svn to compensate for changes in r46307,
which included commits to RCS files with non-trunk default branches.
Notes
Notes:
svn path=/head/; revision=46308
Diffstat (limited to 'contrib/perl5/eg/server')
-rwxr-xr-x | contrib/perl5/eg/server | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/contrib/perl5/eg/server b/contrib/perl5/eg/server new file mode 100755 index 000000000000..49a140a4c2cf --- /dev/null +++ b/contrib/perl5/eg/server @@ -0,0 +1,27 @@ +#!./perl + +$pat = 'S n C4 x8'; +$inet = 2; +$echo = 7; +$smtp = 25; +$nntp = 119; + +$this = pack($pat,$inet,2345, 0,0,0,0); +select(NS); $| = 1; select(stdout); + +if (socket(S,2,1,6)) { print "socket ok\n"; } else { die $!; } +if (bind(S,$this)) { print "bind ok\n"; } else { die $!; } +if (listen(S,5)) { print "listen ok\n"; } else { die $!; } +for (;;) { + print "Listening again\n"; + if ($addr = accept(NS,S)) { print "accept ok\n"; } else { die $!; } + + @ary = unpack($pat,$addr); + $, = ' '; + print @ary; print "\n"; + + while (<NS>) { + print; + print NS; + } +} |