@@ -1203,33 +1203,37 @@ mread conn= do
1203
1203
-- liftIO $ modifyMVar_ (isBlocked conn) $ const $ Just <$> return t
1204
1204
-- deserialize
1205
1205
-- where
1206
- -- perform timeouts and cleanup of the server when connections close
1207
- receiveData' :: Connection -> NWS. Connection -> IO BS. ByteString
1208
- receiveData' c conn = do
1209
- msg <- WS. receive conn
1210
- tr (" RECEIVED" ,msg)
1211
- case msg of
1212
- NWS. DataMessage _ _ _ am -> return $ NWS. fromDataMessage am
1213
- NWS. ControlMessage cm -> case cm of
1214
- NWS. Close i closeMsg -> do
1215
- hasSentClose <- readIORef $ WS. connectionSentClose conn
1216
- unless hasSentClose $ WS. send conn msg
1217
- writeIORef (connData c) Nothing
1218
- cleanConnectionData c
1219
- empty
1220
-
1221
- NWS. Pong _ -> do
1222
- TOD t _ <- liftIO getClockTime
1223
- liftIO $ modifyMVar_ (isBlocked c) $ const $ Just <$> return t
1224
- receiveData' c conn
1225
- -- NWS.connectionOnPong (WS.connectionOptions conn)
1226
- -- NWS.receiveDataMessage conn
1227
- NWS. Ping pl -> do
1228
- TOD t _ <- liftIO getClockTime
1229
- liftIO $ modifyMVar_ (isBlocked c) $ const $ Just <$> return t
1230
- WS. send conn (NWS. ControlMessage (NWS. Pong pl))
1231
- receiveData' c conn
1232
- -- WS.receiveDataMessage conn
1206
+ -- perform timeouts and cleanup of the server when connections
1207
+
1208
+ receiveData' a b= NWS. receiveData b
1209
+ -- receiveData' :: Connection -> NWS.Connection -> IO BS.ByteString
1210
+ -- receiveData' c conn = do
1211
+ -- msg <- WS.receive conn
1212
+ -- tr ("RECEIVED",msg)
1213
+ -- case msg of
1214
+ -- NWS.DataMessage _ _ _ am -> return $ NWS.fromDataMessage am
1215
+ -- NWS.ControlMessage cm -> case cm of
1216
+ -- NWS.Close i closeMsg -> do
1217
+ -- hasSentClose <- readIORef $ WS.connectionSentClose conn
1218
+ -- unless hasSentClose $ WS.send conn msg
1219
+ -- writeIORef (connData c) Nothing
1220
+ -- cleanConnectionData c
1221
+ -- empty
1222
+
1223
+ -- NWS.Pong _ -> do
1224
+ -- TOD t _ <- liftIO getClockTime
1225
+ -- liftIO $ modifyMVar_ (isBlocked c) $ const $ Just <$> return t
1226
+ -- receiveData' c conn
1227
+ -- --NWS.connectionOnPong (WS.connectionOptions conn)
1228
+ -- --NWS.receiveDataMessage conn
1229
+ -- NWS.Ping pl -> do
1230
+ -- TOD t _ <- liftIO getClockTime
1231
+ -- liftIO $ modifyMVar_ (isBlocked c) $ const $ Just <$> return t
1232
+ -- WS.send conn (NWS.ControlMessage (NWS.Pong pl))
1233
+ -- receiveData' c conn
1234
+
1235
+
1236
+ -- --WS.receiveDataMessage conn
1233
1237
{-
1234
1238
mread (Connection _ _ _ (Just (Node2Node _ _ _)) _ _ _ _ _ _ _) = parallelReadHandler -- !> "mread"
1235
1239
@@ -3215,7 +3219,7 @@ dechunk= do
3215
3219
3216
3220
foldNet :: Loggable a => (Cloud a -> Cloud a -> Cloud a ) -> Cloud a -> Cloud a -> Cloud a
3217
3221
foldNet op init action = atServer $ do
3218
- ref <- onAll $ liftIO $ newIORef Nothing -- eliminate additional results doe to unneded parallelism when using (<|>)
3222
+ ref <- onAll $ liftIO $ newIORef Nothing -- eliminate additional results due to unneded parallelism when using (<|>)
3219
3223
r <- exploreNetExclude []
3220
3224
v <- localIO $ atomicModifyIORef ref $ \ v -> (Just r, v)
3221
3225
case v of
0 commit comments