/[mldonkey]/mldonkey/src/utils/net/basicSocket.ml
ViewVC logotype

Diff of /mldonkey/src/utils/net/basicSocket.ml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.17 by spiralvoice, Thu Jul 7 00:25:46 2005 UTC revision 1.18 by spiralvoice, Fri Jul 22 10:58:55 2005 UTC
# Line 243  let must_read t b  = Line 243  let must_read t b  =
243    end    end
244    
245  let print_socket buf s =  let print_socket buf s =
246    Printf.bprintf buf "FD %s:%d: %20s\n"    Printf.bprintf buf "FD %s:%d: %20s"
247       (s.name) (get_fd_num s.fd)       (s.name) (get_fd_num s.fd)
248    (Date.to_string s.born)    (Date.to_string s.born)
249    
# Line 330  let create_blocking name fd handler = Line 330  let create_blocking name fd handler =
330      } in      } in
331  (*  lprintf "ADD ONE TASK\n"; *)  (*  lprintf "ADD ONE TASK\n"; *)
332    if !debug then begin    if !debug then begin
333        lprintf "OPENING: %s" ( sprint_socket t);        lprintf_nl "OPENING: %s" ( sprint_socket t);
334      end;      end;
335    fd_tasks := t :: !fd_tasks;    fd_tasks := t :: !fd_tasks;
336    add_fd_to_event_set t;    add_fd_to_event_set t;
# Line 511  let rec exec_timers = function Line 511  let rec exec_timers = function
511  let loop () =  let loop () =
512    add_infinite_timer 1.0 (fun _ ->    add_infinite_timer 1.0 (fun _ ->
513        if !verbose_bandwidth > 0 then        if !verbose_bandwidth > 0 then
514          lprintf "[BW1] Resetting bandwidth counters\n";          lprintf_nl "[BW1] Resetting bandwidth counters";
515        List.iter (fun f -> try f () with _ -> ()) !bandwidth_second_timers        List.iter (fun f -> try f () with _ -> ()) !bandwidth_second_timers
516    );    );
517    while true do    while true do
# Line 553  timeout := 5.; Line 553  timeout := 5.;
553        select !fd_tasks !timeout;        select !fd_tasks !timeout;
554      with      with
555      | e ->      | e ->
556          lprintf "Exception %s in Select.loop\n" (Printexc2.to_string e);          lprintf_nl "Exception %s in Select.loop" (Printexc2.to_string e);
557    done    done
558    
559    
# Line 567  let shutdown t s = Line 567  let shutdown t s =
567  let nb_sockets () = !nb_sockets  let nb_sockets () = !nb_sockets
568    
569  let stats buf t =  let stats buf t =
570    lprintf "Socket %d\n" (get_fd_num t.fd)    lprintf_nl "Socket %d" (get_fd_num t.fd)
571    
572  let sock_num t = get_fd_num t.fd  let sock_num t = get_fd_num t.fd
573    
# Line 651  let _ = Line 651  let _ =
651        if !debug then        if !debug then
652          let buf = Buffer.create 100 in          let buf = Buffer.create 100 in
653          print_sockets buf;          print_sockets buf;
654          lprintf "%s\n" (Buffer.contents buf);          lprintf_nl "%s" (Buffer.contents buf);
655    )    )

Legend:
Removed from v.1.17  
changed lines
  Added in v.1.18

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26