Skip to content

Commit

Permalink
docs(course): remove connect from network interface
Browse files Browse the repository at this point in the history
  • Loading branch information
symbiont-stevan-andjelkovic committed Feb 2, 2022
1 parent 547934c commit 26af5c6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions doc/advanced-testing-mini-course/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,20 @@

```haskell
data Network = Network
{ deploy :: Addr -> IO Server -- bind and listen
, connect :: Addr -> IO Client
, send :: [(Client, Msg)] -> IO ()
, select :: [Server] -> IO (Addr, Msg, Time) -- accept and recv
{ deploy :: Addr -> IO Socket -- bind and listen
, send :: [(Addr, Msg)] -> IO ()
, select :: [Socket] -> IO (Addr, Msg, Time) -- accept and recv
}

eventLoop :: Network -> [(Addr, StateMachine)] -> IO ()
eventLoop nw nodes = do
servers <- mapM (deploy nw) (map fst nodes)
socks <- mapM (deploy nw) (map fst nodes)
connectAllNodesToEachOther nw nodes
let env = nodes `zip` initialStates
go env
where
go env = do
(receiver, msg, time) <- select servers
(receiver, msg, time) <- select socks
(outgoing, env') <- step env receiver msg time
send nw outgoing
go env'
Expand Down

0 comments on commit 26af5c6

Please sign in to comment.