File tree 5 files changed +10
-5
lines changed
5 files changed +10
-5
lines changed Original file line number Diff line number Diff line change 1
- import netty
1
+ import netty, os
2
2
3
3
var client = newReactor ()
4
4
var connection = client.connect (" 127.0.0.1" , 2001 )
@@ -17,3 +17,4 @@ while true:
17
17
let line = readLine (stdin)
18
18
if line.len > 0 :
19
19
client.send (connection, name & " :" & line)
20
+ sleep (1 )
Original file line number Diff line number Diff line change 1
1
# nim c -r --threads:on --tlsEmulation:off tests\chatclientthreads
2
2
3
- import netty, terminal
3
+ import netty, os, terminal
4
4
5
5
var client = newReactor ()
6
6
var connection = client.connect (" 127.0.0.1" , 2001 )
@@ -60,3 +60,4 @@ while true:
60
60
61
61
# reset character
62
62
singleChar = char (0 )
63
+ sleep (1 )
Original file line number Diff line number Diff line change 1
- import netty
1
+ import netty, os
2
2
3
3
var server = newReactor (" 127.0.0.1" , 2001 )
4
4
echo " Listenting for UDP on 127.0.0.1:2001"
@@ -13,3 +13,4 @@ while true:
13
13
# send msg data to all connections
14
14
for connection in server.connections:
15
15
server.send (connection, msg.data)
16
+ sleep (1 )
Original file line number Diff line number Diff line change 1
- import netty
1
+ import netty, os
2
2
3
3
# create connection
4
4
var client = newReactor ()
@@ -14,3 +14,4 @@ while true:
14
14
for msg in client.messages:
15
15
# print message data
16
16
echo " GOT MESSAGE: " , msg.data
17
+ sleep (1 )
Original file line number Diff line number Diff line change 1
- import netty
1
+ import netty, os
2
2
3
3
# listen for a connection on localhost port 1999
4
4
var server = newReactor (" 127.0.0.1" , 1999 )
@@ -13,3 +13,4 @@ while true:
13
13
echo " GOT MESSAGE: " , msg.data
14
14
# echo message back to the client
15
15
server.send (msg.conn, " you said:" & msg.data)
16
+ sleep (1 )
You can’t perform that action at this time.
0 commit comments