
中山市博安通通信技术有限公司
ZHONGSHAN B&T TECHNOLOGYCo., Ltd
Page 21 of 34
3:<con_id> not find
4:recvfrom() error for udp server
5:recvfrom() error for udp client/seed not found
6:TCP server should receive from seed (the server needs to read from the client, not
directly read
server)
7:connection lost
8:read() error for tcp con_id
Note
If it is a TCP server, data cannot be read or written from the con_id of the server
Subcon_id reads and writes data
Example // The UDP server reads the data
# ATPN=B&T-1,test123456
[ATPN] OK
# ATPS = 1400, 5
#
[ATPS] OK
[ATPS] con_id=2
# ATPI
Con_id: 1, server, TCP, address: 192.168.20.115, port: 4004, sockets: 0
Con_id: 2, server, udp, address: 192.168.20.115, port: 4005, sockets: 1
[ATPI] OK
// Use the socket tool to send data to 192.168.20.115:4005
# ATPR = 2100
[ATPR] OK, 8,2,192.168. 20.112, 10086: the test of STR
//TCP server reads data
# ATPN=B&T-1,test123456
[ATPN] OK
# ATPS = 0400 4
#
[ATPS] OK
[ATPS] con_id=1
// When the client is connected
[ATPS] A client connected to server[1]
Con_id: 3, seed, TCP, address: 192.168.20.112, port: 52451, sockets: 2
# ATPI
Con_id: 1, server, TCP, address: 192.168.20.115, port: 4004, sockets: 0
Con_id: 3, seed, TCP, address: 192.168.20.112, port: 52451, sockets: 2
Con_id: 2, server, udp, address: 192.168.20.115, port: 4005, sockets: 1
[ATPI] OK
// The client sends data
# ATPR = 3100
[ATPR] OK,8,3:test str