User guide

Redpine Signals, Inc. Proprietary and Confidential. Page 164
R
R
S
S
9
9
1
1
1
1
0
0
-
-
N
N
-
-
1
1
1
1
-
-
2
2
2
2
/
/
2
2
4
4
/
/
2
2
8
8
S
S
o
o
f
f
t
t
w
w
a
a
r
r
e
e
P
P
r
r
o
o
g
g
r
r
a
a
m
m
m
m
i
i
n
n
g
g
R
R
e
e
f
f
e
e
r
r
e
e
n
n
c
c
e
e
M
M
a
a
n
n
u
u
a
a
l
l
V
V
e
e
r
r
s
s
i
i
o
o
n
n
4
4
.
.
1
1
5
5
4.10.10 Remote Termination
Description
The TCP peer can remotely terminate the connection asynchronously. The
Remote termination frame indicates termination of the connection (preceded by
an interrupt, at which the Host should read the frame from the module). This
message is sent from module to Host in the following cases:
1.The remote TCP peer closes the socket connection
2.The module closes the socket connection. This could happen if the module tries
to send data to a remote peer but fails to do so (because of abrupt closure of
remote peer etc.). The module tries to resend the data, but after a number of
retries, sends this message to the host and closes the socket.
3.When the module tries to open a client TCP socket, and during the handshake
process with the remote peer, a “TCP reset packet” is sent by the remote peer.
Host should act accordingly upon the reception of the remote termination (i.e.,
close and re-open the socket. This is left to the developer‟s discretion).
Relevance
This command is relevant when the TCP/IP stack is enabled.
Frame Body
The following is the data structure for the Remote termination frame.
struct TCP_EVT_RemoteTerminate
{
UINT16 uSocketDescriptor;
UNIT32 nErrorCode;
};
Structure Member
Name
Description
uSocketDescriptor
Socket descriptor for which the
Remote termination has happened.
nErrorCode
0 Default return value,
-121: Socket creation failed.
The identifier for this frame (0x05) can be found in Data Frame Based
Response Codes (sent from module to host).
4.11 Send and Receive Data in TCP/IP Bypass mode
In TCP/IP bypass mode, the Host sends Ethernet frames from its own
TCP/IP stack to the module for transmission, or receives Ethernet frames
from the module as received data.