Help for this page

Select Code to Download


  1. or download this
    A common misconception in socket programming is that "\n"
    eq "\012" everywhere.  When using protocols such as common
    Internet protocols, "\012" and "\015" are called for
    specifically, and the values of the logical "\n" and "\r"
    (carriage return) are not reliable.
    
  2. or download this
    print SOCKET "Hi there, client!\r\n";      # WRONG
    print SOCKET "Hi there, client!\015\012";  # RIGHT