Closed craffert0 closed 5 years ago
I'm sad to report that the existing XBee Cellular API frames don't include a method for the module to notify the host that the remote end has closed the connection. If this is an important feature for you, I suggest pushing on your sales contact at Digi International to have them update the product's APIs to provide a better sockets interface.
I recently pushed code to use the new Sockets API frames, which include notification of closed sockets. Take a look at xbee/sockets.h
and xbee/xbee_sockets.c
for support code, and the socket_test
and xbee_netcat
sample programs.
In the documentation for API mode behavior for outgoing TCP and SSL connections, it says "a connection is closed when the remote end closes the connection...". How can I get a notification (or poll) when this happens?
I am using API operating mode, and our frame handlers look like this:
When we receive data from the remote host, we get a callback on
ipv4_rx_handler
as expected. But when the remote host explicitly closes its end of the TCP/IP connection, we never get a callback on anything.Is there another frame handler that we can set up? Or a setting to get a zero-length data result on the receive handle? Or something to poll?