TCPSocket.Error
From Xojo Documentation
Event
An error occurred or the connection was either dropped or deliberately ended.
Notes
The LastErrorCode property will hold a value that indicates what happened. Please refer to the list of error codes and corresponding class constants for the SocketCore class. Use the class constants to test against the value in LastErrorCode.