User's Manual

5.
typ
e
cre
a
}SO
typ
e
{
}SO
PR
O
{
}
N
etw
Because
confirm
t
connecti
waiteve
Wecan
k
e
defenum
SOCKET_
C
SOCKET_
C
SOCKET_
S
SOCKET_
N
SOCKET_
N
a
ted.
CKETSTATE
;
e
defstruct
NETSOCK
E
U16
SOCKETS
T
CKETMSG;
O
CESS_THR
E
PROCESS
_
SOCKETM
while(1)
PRO
C
if(ev


}
}
PROCESS
_
AI6
0
ork pr
o
thisisnon
b
t
heTCPco
n
oncoming.
ntPROCES
S
k
nowthis
m
t_SOCKETS
T
C
ONNECTE
D
C
LOSED,
S
ENDACK,
N
EWDATA,
N
EWCONN
E
;
t_SOCKET
M
E
T socke
t
 lport;
T
ATEstatus;
E
AD(tcp_c
o
_
BEGIN();
SGmsg;
{
C
ESS_WAIT
_
==PROCES
msg=*(S
O
//Doingthi
_
END();
0
60
H
o
gram
m
b
lackIO.W
e
n
nection,s
e
Thereisa
s
S
_EVENT_
M
m
essageco
m
T
ATE{
D
,



E
CTION, 
M
SG
t
;
o
nnect_pro
c
_
EVENT();
S_EVENT_
M
O
CKETMSG
*
ngsdepen
d
H
Us
e
-31-
m
ing
e
needtoc
r
e
nddatais
c
s
impleexa
m
M
SGandth
e
m
efromw
h
TCPsoc
k
TCPcon
n
Thesen
d
Thereis
n
Anewc
c
ess,ev,da
t
M
SG){
*
)data;
d
onwhich
e
r M
a
r
eateapro
c
c
ompleted
o
m
pleshow
b
e
datapoin
t
h
ichsocket,
k
etisconn
e
n
ectioniscl
o
d
dataproc
e
n
ewdatac
o
onnection
f
t
a)
message
a
nual
Copyrigh
c
esstoget
m
o
rthereis
n
b
elow.Pro
c
t
ertypeisS
portands
t
e
cted.
o
sed.
e
dureisco
m
o
ming.
f
romlisteni
n
h
t@2016 A
m
essagea
n
n
ewdatao
r
c
essneedt
o
S
OCKETMS
G
t
atus.
m
pleted.
ngportis
c
SiP
n
d
r
o
G
.