Help for this page

Select Code to Download


  1. or download this
    use strict;
    use Socket;
    ...
    defined(send($incoming, "2", 0)) || die "Send error: $!";
    shutdown($incoming, 2);
    shutdown($socket, 2);
    
  2. or download this
    use strict;
    use Socket;
    ...
    defined(recv($socket, $message, $messageLen, 0)) or die "Receive error
    +: $!";
    print "I got the following message: $message.\n";
    shutdown($socket, 2);