Verified Commit fb773dae authored by Camil Staps's avatar Camil Staps
Browse files

Update TCPIP/ObjectIO for strict maybes in TCPIP library

parent 0987b0f8
implementation module osevent implementation module osevent
import StdBool, StdList, StdMisc, StdTuple import StdBool, StdList, StdMaybe, StdMisc, StdTuple
import clCrossCall_12, ostime, ostoolbox, ostypes import clCrossCall_12, ostime, ostoolbox, ostypes
from commondef import hdtl, fatalError from commondef import hdtl, fatalError
from StdMaybe import :: Maybe(..) from StdMaybe import :: Maybe(..)
......
implementation module osevent implementation module osevent
import StdInt, StdBool, StdList, StdTuple import StdInt, StdBool, StdList, StdMaybe, StdTuple
import events, desk, pointer import events, desk, pointer
import StdClass, StdMisc import StdClass, StdMisc
import code from "cTCP." import code from "cTCP."
......
...@@ -81,11 +81,11 @@ instance Receivers TCP_ListenerReceiver where ...@@ -81,11 +81,11 @@ instance Receivers TCP_ListenerReceiver where
= open_RChan_or_Listener close_listener ls id rAttributes endpointRef 0 (handleConnectRequest f) ListenerReceiver pSt = open_RChan_or_Listener close_listener ls id rAttributes endpointRef 0 (handleConnectRequest f) ListenerReceiver pSt
where where
handleConnectRequest f (IE_CONNECTREQUEST,endpointRef,_) (ls,ps=:{io}) handleConnectRequest f (IE_CONNECTREQUEST,endpointRef,_) (ls,ps=:{io})
# (_, mbHostDuplexChan,_,io) = receive_MT (Just 0) (pack_tcplistener endpointRef) io # (_, mbHostDuplexChan,_,io) = receive_MT (?Just 0) (pack_tcplistener endpointRef) io
= case mbHostDuplexChan of = case mbHostDuplexChan of
Nothing ?None
-> (ls, {ps & io=io}) -> (ls, {ps & io=io})
Just hostDuplexChan ?Just hostDuplexChan
-> f (Received hostDuplexChan) (ls, {ps & io=io}) -> f (Received hostDuplexChan) (ls, {ps & io=io})
getReceiverType _ getReceiverType _
...@@ -178,7 +178,7 @@ where ...@@ -178,7 +178,7 @@ where
handleReceiveEvent :: !Id !Int ((ReceiveMsg ByteSeq) -> *(.ls, PSt .a) -> *(.ls, PSt .a)) (!InetEvent, !EndpointRef, !Int) *(.ls, PSt .a) -> *(.ls, PSt .a) handleReceiveEvent :: !Id !Int ((ReceiveMsg ByteSeq) -> *(.ls, PSt .a) -> *(.ls, PSt .a)) (!InetEvent, !EndpointRef, !Int) *(.ls, PSt .a) -> *(.ls, PSt .a)
handleReceiveEvent _ maxSize f (IE_RECEIVED,endpointRef,_) (ls,ps=:{io}) handleReceiveEvent _ maxSize f (IE_RECEIVED,endpointRef,_) (ls,ps=:{io})
# (_,mbTCPData,_,io) = receive_MT (Just 0) (pack_tcprchan (endpointRef,maxSize)) io # (_,mbTCPData,_,io) = receive_MT (?Just 0) (pack_tcprchan (endpointRef,maxSize)) io
| isNothing mbTCPData | isNothing mbTCPData
= (ls,{ps & io=io}) = (ls,{ps & io=io})
= f (Received (fromJust mbTCPData)) (ls,{ps & io=io}) = f (Received (fromJust mbTCPData)) (ls,{ps & io=io})
......
...@@ -48,7 +48,7 @@ instance SelectReceive Void ...@@ -48,7 +48,7 @@ instance SelectReceive Void
accRChannels _ void accRChannels _ void
= ([],void) = ([],void)
getRState _ void env getRState _ void env
= (Nothing, void, env) = (?None, void, env)
instance getNrOfChannels (:^: *x *y) | getNrOfChannels x & getNrOfChannels y instance getNrOfChannels (:^: *x *y) | getNrOfChannels x & getNrOfChannels y
where where
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment