Technical information
Direct Socket Interface
2-40 AT+i Commands Reference Manual May 31, 2008
The Socket Command Abort may be used to abort prematurely.
+iSCLS - Close Socket
% When the flush-and-acknowledge (%) flag is specified and <hn>
is a TCP socket handle, W24 flushes and waits for the peer
receipt acknowledgment of all outstanding outbound data.
Common errors associated with this flag are 215 (carrier lost) and
203 (socket closed by peer in an orderly manner or did not receive
ACK after repeated attempts to retransmit unacknowledged data).
Result Code:
I/OK If <hn> is a handle to an open socket and, when <hn> is a TCP
socket handle, all outbound data has been received (and when (%)
flag specified also acknowledged) by peer.
I/ERROR Otherwise.
Syntax: AT+i[!]SCLS:<hn>
Closes a TCP/UDP socket.
If the socket is the only open socket and the stay online flag (!) is
not specified, W24 terminates the Internet session and goes
offline.
Parameters:
<hn> A TCP/UDP socket handle of an open socket.
Command Options:
<hn> Must have been obtained by a previous execution of an
AT+iLTCP, AT+iSTCP or AT+iSUDP command during the
current Internet mode session. Or a socket accepted by a listening
socket.
A socket is always flushed before being closed. TCP sockets are
disconnected from the remote host server in an orderly manner.
! Stay online after completing the command.
Result Code:
I/OK If <hn> is a handle to an open socket.
I/ERROR Otherwise.
Followed by:
I/DONE After successfully closing the last open socket. Allow a 2.5
seconds delay for W24 re-initialization following an Internet
mode session.
-or-
I/ONLINE After successfully closing the socket, while additional sockets are
still open or if the stay online flag (!) is specified.
-or-
I/ERROR Otherwise.










