Name: socketError

Type: message

Syntax: socketError <pSocketID>, <pErrorString>

Summary:
Sent when an <error> occurs on a <socket> that causes the <socket> to
close or to fail to open.

Associations: stack, card, field, button, graphic, scrollbar, player,
image

Introduced: 1.0

OS: mac, windows, linux, ios, android

Platforms: desktop, server, mobile

Example:
on socketError theID, theError
  answer error "There is a problem with the connection." \
     with "Debugging Info" or "Cancel"
  if it is "Debugging Info" then answer information theError
  close socket theID
end socketError

Parameters:
pSocketID:
The identifier (set when you opened the socket) of the socket which had
an error. The socket identifier starts with the IP address of the host
the socket is connected to, and may optionally include a port number
(separated from the IP address by a colon). If there is more than one
socket connected to that host and port, you can specify which socket by
appending the connection name or number that was assigned when the
socket was opened, separated from the port number by a vertical bar (|).

pErrorString (string):
A description of the socket error.

Description:
Handle the <socketError> <message> to perform cleanup after a <socket>
closes due to a problem receiving or sending data.

The <socketError> <message> is sent to the <object(glossary)> that
opened the <socket>.

If the socket is closed by the remote host normally, rather than due to
an error, the socketClosed <message> is sent instead of <socketError>.

References: resetAll (command), object (glossary), error (glossary),
message (glossary), socket (glossary), socketTimeout (message)

Tags: networking

