Livecode Wiki
Advertisement

A Message sent when the remote system closes a socket. If there is a message handler by the same name in the message path, then it will be executed.

Message[]

Syntax:

socketClosed <socketID>

The parameter <socketID> is the identifier (set when you opened the socket) of the socket that'sjust been closed. The socket identifier starts with the IP address ofthe host the socket is connected to, and may optionally include a portnumber (separated from the IP address by a colon). If there is more thanone socket connected to that host and port, you can specify which socketby appending the connection name or number that was assigned when thesocket was opened, separated from the port number by a vertical bar (|).

The socketClosed message is sent to the object that opened the socket.

If the socket closed due to an error, the socketError message is sent instead of socketClosed message.

Message handler[]

Examples:

on socketClosed theID -- close a progress window for the socket
  set the itemDelimiter to "|" -- get just the assigned name
  if there is a window (last item of theID)
  then close stack (last item of theID)
end socketClosed

Use the socketClosed Message handler to perform cleanup after the remote system closes a socket.

See also: socketTimeout.

Advertisement