1. Kota UENISHI
  2. ocaml-bert

Commits

UENISHI Kota  committed 22806a2

bad code modified

  • Participants
  • Parent commits e31a93a
  • Branches default

Comments (0)

Files changed (2)

File OMakefile

View file
 
 FILES[] =
      tcp_server
-     bert
 
 PROGRAM = tcp_server
 OCAML_LIBS +=

File tcp_server.ml

View file
 	treat_connection client
     done;;
 
-Printf.printf "staring server in 10009\n";;
-let callback (csock, caddr) = 
+let accept_callback (csock, caddr) = 
 (*  print_endline (string_of_inet_addr ADDR_UNIX (addr)); *)
   begin match caddr with
     | ADDR_INET(caller, _)->
     prerr_endline ((string_of_int len) ^ " bytes recv'd");
     prerr_endline buffer;
     close csock;
-    prerr_endline "----------------" in
-  handle_unix_error tcp_server callback;;
+    prerr_endline "----------------";;
 
-(*    print_endline (string_of_inet_addr ADDR_UNIX(addr)); 
-  let (sockaddr, port) = addr in
-    Printf.printf "accepting %d " port;
-*)
+(* print_endline (string_of_inet_addr ADDR_UNIX(addr));  *)
+Printf.printf "staring server in 10009\n";;
+handle_unix_error tcp_server accept_callback;;
+
+
+
+