-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsocktest.src
63 lines (53 loc) · 822 Bytes
/
socktest.src
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
!include sbbsdefs.inc
int sock len
str buf
socket_open sock
if_false
print "open failure\r\n"
return
end_if
setstr "cvs.synchro.net"
socket_connect sock str 23
if_false
print "connect failure\r\n"
return
end_if
or _console CON_RAW_IN
loop
inchar
if_true
compare_key ^]
if_equal
break
end_if
copy_char buf
socket_write sock buf
if_false
print "\r\nError writing to socket\r\n"
break
end_if
continue
end_if
socket_check sock
if_false
print "\r\nSocket disconnected\r\n"
break
end_if
socket_nread sock len
if_false
print "\r\nError getting read length\r\n"
break
end_if
compare len 0
if_equal
continue
end_if
# printf "reading %d" len
socket_read sock buf len
if_true
pause_reset
print buf
end_if
end_loop
socket_close sock
xor _console CON_RAW_IN