Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
clean-and-itasks
clean-libraries
Commits
cc63cc9c
Commit
cc63cc9c
authored
Sep 07, 2020
by
John van Groningen
Browse files
Use strict maybe types in TCPIP library examples
parent
b7959bd8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Examples/TCPIP/chat/chatServer.icl
View file @
cc63cc9c
...
...
@@ -34,7 +34,7 @@ loop listener channels console world
=
unzip3
channels
glue
=
(
TCP_Listeners
[
listener
])
:^:
(
TCP_RChannels
rChans
)
([(
who
,
what
):_],
glue
,
_,
world
)
=
selectChannel_MT
No
thing
glue
Void
world
=
selectChannel_MT
?
No
ne
glue
Void
world
((
TCP_Listeners
[
listener
:_])
:^:
(
TCP_RChannels
rChans
))
=
glue
channels
=
zip3
sChans
rChans
nicknames
...
...
@@ -43,7 +43,7 @@ loop listener channels console world
|
who
==
0
#
(
tReport
,
mbNewMember
,
listener
,
world
)
=
receive_MT
(
Just
0
)
listener
world
=
receive_MT
(
?
Just
0
)
listener
world
|
tReport
<>
TR_Success
// the potential new member changed it's mind
=
loop
listener
channels
console
world
#
(_,{
sChannel
,
rChannel
})
=
fromJust
mbNewMember
...
...
Examples/TCPIP/downloadHTTP/downloadHTTP.icl
View file @
cc63cc9c
...
...
@@ -30,7 +30,7 @@ Start world
// connect
#
(
tReport
,
mbDuplexChan
,
world
)
=
connectTCP_MT
(
Just
(
15
*
ticksPerSecond
))
=
connectTCP_MT
(
?
Just
(
15
*
ticksPerSecond
))
(
fromJust
mbIPAddr
,
port
)
world
|
tReport
<>
TR_Success
#!
console
=
fwrites
(
server
+++
" does not respond on port "
...
...
@@ -46,7 +46,7 @@ Start world
// receive answer
(
tReport
,
mbBs
,
rc
,
world
)
=
receive_MT
(
Just
(
20
*
ticksPerSecond
))
rc
world
(
tReport
,
mbBs
,
rc
,
world
)
=
receive_MT
(
?
Just
(
20
*
ticksPerSecond
))
rc
world
console
=
case
tReport
of
TR_Success
->
fwrites
(
toString
(
fromJust
mbBs
))
console
_
->
fwrites
(
server
+++
" does not send anything (timeout expired)"
)
...
...
Examples/TCPIP/echo/echoClient.icl
View file @
cc63cc9c
...
...
@@ -29,7 +29,7 @@ Start world
// connect
#
(
tReport
,
mbDuplexChan
,
world
)
=
connectTCP_MT
(
Just
(
15
*
ticksPerSecond
))
=
connectTCP_MT
(
?
Just
(
15
*
ticksPerSecond
))
(
fromJust
mbIPAddr
,
echoPort
)
world
|
tReport
<>
TR_Success
#!
console
=
fwrites
(
server
+++
" does not respond on port "
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment