Further integration of lwt, irc basically works
This commit is contained in:
12
irc.ml
12
irc.ml
@ -53,7 +53,11 @@ module Communicator = struct
|
||||
C.reconnect_loop ~after:30
|
||||
~connect:(fun () ->
|
||||
Lwt_io.printl "Connecting..."
|
||||
>>= fun () -> C.connect_by_name ~server ~port ~nick () )
|
||||
>>= fun () ->
|
||||
C.connect_by_name ~server ~port ~nick ()
|
||||
>>= fun c ->
|
||||
Lwt_io.printl "connect_by_name returned"
|
||||
>>= fun () -> Lwt.return c )
|
||||
~f:(fun connection ->
|
||||
Lwt_io.printl "Connected"
|
||||
>>= fun () ->
|
||||
@ -89,7 +93,7 @@ module Communicator = struct
|
||||
F.pf pp " <><><> COMMUNICATOR <><><> @.@." ;
|
||||
List.iter
|
||||
(fun msg -> F.pf pp "[%s] %s@." msg.time msg.content)
|
||||
c.channel.content )
|
||||
(List.rev c.channel.content) )
|
||||
end
|
||||
end
|
||||
|
||||
@ -98,8 +102,8 @@ let _ =
|
||||
let hackint =
|
||||
Communicator.Irc.connection comm "irc.hackint.org" 6697 "cqcaml"
|
||||
["#CQC"] in
|
||||
root_actor := std_actor (Communicator.Panel.panel comm) ;
|
||||
Lwt.async (fun () -> hackint)
|
||||
Lwt.async (fun () -> hackint) ;
|
||||
root_actor := std_actor (Communicator.Panel.panel comm)
|
||||
|
||||
(**
|
||||
program starts...
|
||||
|
||||
Reference in New Issue
Block a user