User's Manual

5.1
T
Callfu
n
SOCKE
T
httpso
c
&http_re
q
//wait
f
PROCE
S
msg=
*
if(msg.
s
pr
g
o
}
Sendd
a
Callfu
n
Before
g
buffer.
tcpsen
d
//Wait
f
PROCE
S
msg=
*
if(msg.
s
pr
}else{
pr
g
o
}
Receiv
e
Waitfo
incomi
n
PROCE
S
msg=
*
AI6
0
T
CP clie
n
Create
a
n
ctiontcpc
o
T
_CONNEC
T
c
k=tcpcon
n
q
uest_proc
e
f
orTCPcon
n
S
S_WAIT_E
V
*
(SOCKETM
s
tatus!=S
O
intf("TCPc
o
o
todisscon
n
a
tatothe
p
n
ctiontcps
e
g
ettheSO
C
d
(httpsock,
f
ordatais
t
S
S_WAIT_E
V
*
(SOCKETM
s
tatus==S
O
intf("TCPs
e
intf("TCPs
e
o
todisscon
n
e
datafro
m
rSOCKET_
N
n
gdata.
S
S_WAIT_E
V
*
(SOCKETM
0
60
H
n
t prog
r
a
TCPconn
e
o
nnecttost
a
T
EDmessa
g
n
ect(&gNe
t
e
ss);
n
ectedort
i
V
ENT_UNTI
SG*)data;
O
CKET_CON
o
nnectfail!
n
ect;
p
eerside
ndtosend
C
KET_SEND
A
httpstring,
t
ransmitted
V
ENT_UNTI
SG*)data;
O
CKET_SEN
e
ndsuccess
e
ndfail!Po
s
n
ect;
m
peerside
N
EWDATA
m
V
ENT_UNTI
SG*)data;
H
Us
e
-32-
r
ammin
g
e
ction
artTCPco
n
g
e.
t
Status.re
m
i
meout.
I
L(ev==PR
O
NECTED){
Postmess
a
datatope
e
A
CKmessa
g
strlen(htt
p
oruip_tim
I
L(ev==PR
O
DACK){
ful\n");
s
tmessage
m
essageth
e
I
L(ev==PR
O
e
r M
a
g
necttope
e
m
ote_ip_ad
d
O
CESS_EVE
a
getype:%
d
e
rsideand
w
g
e,please
d
p
string));
eout.
O
CESS_EVE
type:%d\n
"
e
ncallfunc
t
O
CESS_EVE
a
nual
Copyrigh
e
rsideand
n
d
r,gNetStat
N
T_MSG);
d
\n",msg.st
w
aitforac
k
d
onotmod
i
N
T_MSG);
"
,msg.statu
t
iontcprec
v
N
T_MSG)
h
t@2016 A
needwait
f
t
us.port,
t
atus);
k
nowledge.
ifythedat
a
u
s);
v
toget
c
SiP
f
or