User's Manual


T
P
\
C
P
if(msg.
s
re
c
}

Closec
o
Callfu
n
tcpclos
e
T
hereisasi
m
P
leaserefer
C
abriocon
t
P
ROCESS_T
H
5.2
T
Liste
n
Callfu
n
tcpliste
Accept
Waitfo
fromm
PROCE
S
msg=
*
if(msg.
s
gs
e
}
Attach
Thene
w
default
proces
s
functio
tcpattc
h
Stopli
s
AI6
0
s
tatus==S
O
c
vlen=tcp
r
o
nnection
n
ctiontcpcl
o
e
(httpsock)
m
pleexam
p
t
ikisrc\exa
m
H
READ(htt
p
T
CP ser
v
n
aTCPpor
t
n
ctiontcplis
n(localport
,
anewcon
n
rSOCKET_
N
essage.
S
S_WAIT_E
V
*
(SOCKETM
s
tatus==S
O
e
rversock
=
anotherpr
o
w
connecti
o
callbackpr
s
ofthissoc
n.
h
(gservers
o
s
tenaTCP
p
0
60
H
O
CKET_NE
W
r
ecv(httpso
c
o
setoclos
e
;
p
le“HTTPr
e
m
ples\sock
e
_request_
p
v
er prog
r
t
tentoliste
n
,
&tcp_con
n
n
ection
N
EWCONN
E
V
ENT_UNTI
SG*)data;
O
CKET_NE
W
=
msg.socke
o
cess.
o
nwilluse
t
ocess.Ifw
e
ket,itcan
c
o
ck,&client
_
p
ort
H
Us
e
-33-
W
DATA){
c
k,buffer_i
e
connectio
n
e
questto
s
e
t_proc\so
c
p
rocess,ev,
r
ammin
n
theTCPp
n
ect_proce
E
CTIONme
s
I
L(ev==PR
O
W
CONNECT
I
t;
t
hecallbac
k
e
wantano
t
c
allfunctio
n
_
handle_p
r
e
r M
a
n,MAX_SE
N
n
.
s
howhow
t
c
ket_proc.c
data)
g
ort.
ss)
s
sageand
g
O
CESS_EVE
I
ON){
k
processr
e
t
herproces
s
n
tcpattach
t
r
ocess);
a
nual
Copyrigh
N
D_BUFFE
R
t
heTCPclie
etthenew
N
T_MSG)
gisterbytc
s
tobethe
c
t
oreplace
t
h
t@2016 A
R
);
e
ntworking
.
socketnu
m
plistenas
callback
t
hecallbac
k
c
SiP
.
m
ber
k