Help for this page

Select Code to Download


  1. or download this
    print $server "FOO request\n";
    
    my $response = <$server>;
    # or my $bytes_read = read($server, $response, 4192);
    # or whatever--basically, just read from the server
    
  2. or download this
    my $client = $server->accept;
    my $request = <$client>;
    ...
    # generate a response
    print $client $response;
    close $client;