void socket_connected(int handle; int new; int wherefrom; int port)
{
  define_socket_to_text(new, "\0a\0d", 2, 1) ;
  line_to_socket(new, "********************************************************************\0a\0d") ;
  line_to_socket(new, "*                                                                  *\0a\0d") ;
  line_to_socket(new, "*  This is a demonstration RabbitScript that listens on port 1234  *\0a\0d") ;
  line_to_socket(new, "*  and sends this  message to anything that connects. It  doesn't  *\0a\0d") ;
  line_to_socket(new, "*  do anything  really useful  other than  send this  pointlessly  *\0a\0d") ;
  line_to_socket(new, "*  long message.                                                   *\0a\0d") ;
  line_to_socket(new, "*                                                                  *\0a\0d") ;
  line_to_socket(new, "********************************************************************\0a\0d") ;
  line_to_socket(new, int_to_dotted_ip(wherefrom)) ;
  line_to_socket(new, "\0a\0d") ;
  line_to_socket(new, int_to_string(port)) ;
  line_to_socket(new, "\0a\0d") ;
  close_socket(new) ;
}

void main()
{
  init("Listen", "Send a silly message", "Sham Gardner", "0.00 (December 1997)", 0) ;

  int port, socket ;
  port=1234 ;
  socket=create_listening_socket(port) ;
  if (socket < 0)
  {
    report_error("Unable to bind port 1234, is something else using it?") ;
    quit() ;
  }
}
