X-Git-Url: https://git.martlubbers.net/?a=blobdiff_plain;f=Devices%2FmTaskTCP.icl;h=dfa7f2fbe3dfbad2b62504db46f528c0c9fa2fc4;hb=03f652f7afb24678d565d1b12f12b0fa27444dd2;hp=e0b85e2d57fe4057692aa0b5de9d6a2331376120;hpb=7fec7868123d56d410e807042cb3e031ebda12b9;p=mTask.git diff --git a/Devices/mTaskTCP.icl b/Devices/mTaskTCP.icl index e0b85e2..dfa7f2f 100644 --- a/Devices/mTaskTCP.icl +++ b/Devices/mTaskTCP.icl @@ -24,9 +24,9 @@ instance MTaskDuplex TCPSettings where 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)