muba has asked for the wisdom of the Perl Monks concerning the following question:
# just the basics use strict; use warnings; use Socket; # start up the server socket (SERVER, PF_INET, SOCK_STREAM, getprotobyname('tcp')); setsockopt(SERVER, SOL_SOCKET, SO_REUSEADDR, 1); # My book says to use inet_aton($host) # that would be inet_aton('localhost') # but inet_aton seems to return v127.0.0.1 so I prefer to use that my $addr = sockaddr_in(110, v127.0.0.1); bind(SERVER, $addr) or die "Could not bind to port"; listen(SERVER, SOMAXCONN) or die "Could nit listen to port"; my $lines = 0; # how many lines are sent by the client my $line; # current line accept(CLIENT, SERVER); # just to be sure: binmode CLIENT; binmode SERVER; print "Nieuwe verbinding...\n"; # Dutch for 'new connection' # new connection? Send something to client print CLIENT "+OK\n"; # ... code goes on, but the above line seems never sended to the clien +t.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: `print CLIENT` seems to send nothing with `use Socket`
by matija (Priest) on Apr 03, 2004 at 16:31 UTC | |
by muba (Priest) on Apr 03, 2004 at 16:42 UTC | |
|
Re: `print CLIENT` seems to send nothing with `use Socket`
by Abigail-II (Bishop) on Apr 03, 2004 at 15:39 UTC | |
by muba (Priest) on Apr 03, 2004 at 15:48 UTC | |
by Abigail-II (Bishop) on Apr 03, 2004 at 21:48 UTC |