onDisconnect=onDisconnect} @! ()
where
onConnect :: String ([MTaskMSGRecv],[MTaskMSGSend],Bool) -> (MaybeErrorString String, Maybe ([MTaskMSGRecv],[MTaskMSGSend],Bool), [String], Bool)
- onConnect acc (msgs,send,sendStopped) = (Ok acc, Just (msgs,[],sendStopped), map encode send, False)
+ onConnect acc (msgs,send,sendStopped) = (Ok "", Just (msgs,[],sendStopped), map encode send, False)
whileConnected :: (Maybe String) String ([MTaskMSGRecv], [MTaskMSGSend],Bool) -> (MaybeErrorString String, Maybe ([MTaskMSGRecv],[MTaskMSGSend],Bool), [String], Bool)
//We stop
= (Ok acc, Just (msgs++map decode nd,[],sendStopped), map encode send, False)
process :: String -> (String, [String])
- process s = case indexOf "\n" s of
+ process s
+ | not (trace_tn ("process: " +++ toString (toJSON s))) = undef
+ = case indexOf "\n" s of
-1 = (s, [])
- i = appSnd (\ss->[s % (0,i):ss]) (process (s % (i+1, size s)))
+ i = appSnd (\ss->[s % (0,i-1):ss]) (process (s % (i+1, size s)))
onDisconnect :: String ([MTaskMSGRecv],[MTaskMSGSend],Bool) -> (MaybeErrorString String, Maybe ([MTaskMSGRecv],[MTaskMSGSend],Bool))
onDisconnect _ (msgs,send,sendStopped) = (Ok "", Nothing)