onConnect _ (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)
- whileConnected mnewData acc (msgs,send,sendStopped)
- | not (trace_tn (printToString (map decode (maybeToList mnewData)))) = undef
- = (Ok acc, Just (msgs ++ map decode (maybeToList mnewData),[],sendStopped), map encode send, False)
+ whileConnected Nothing _ (_,[],_) = (Ok "", Nothing, [], False)
+ whileConnected md _ (msgs,send,sendStopped)
+ = (Ok "", Just (msgs++map decode (maybeToList md),[],sendStopped), map encode send, False)
onDisconnect :: String ([MTaskMSGRecv],[MTaskMSGSend],Bool) -> (MaybeErrorString String, Maybe ([MTaskMSGRecv],[MTaskMSGSend],Bool))
- onDisconnect l (msgs,send,sendStopped) = (Ok l, Nothing)
+ onDisconnect _ (msgs,send,sendStopped) = (Ok "", Nothing)