Help for this page

Select Code to Download


  1. or download this
    $line = "Hello, world!\n";
    $port = 2000;
    ...
    print SOCKET ("$line\n");
    close (SOCKET);
    close (SSOCKET);
    
  2. or download this
    $port = 2000;
    while (getservbyport ($port, "tcp")) {
    ...
    $line = <SOCKET>;
    print ("$line\n");
    close (SOCKET);