ThingWorx Edge C SDK > Error Codes > Websocket Errors
  
Websocket Errors
A Websocket connection is run using a system socket; a system socket sits one layer lower in the networking stack. All Websocket errors indicate some general issue communicating with ThingWorx platform. The following table lists websocket errors, their corresponding codes, and an explanation of the issue.
* 
As of release 1.2 of the C SDK, the default setting for DEFAULT_SOCKET_ READ_TIMEOUT in twDefaultSettings.h is 500 ms. If you are using axTLS (v.2.2.0 and earlier of the C SDK) and a websocket read times out in the middle of reading a record, the SSL state is lost. As a result, the SDK tries to start reading the record header again, and the operation fails. To detect this situation, check the log for the SDK for the error, twTlsClient_Read:TimedoutafterXmilliseconds, and consider increasing the value of the DEFAULT_SOCKET_READ_TIMEOUT. You can change the setting at runtime by modifying the value of twcfg.socket_ read_timeout.
Code
Message
Troubleshooting
200
TW_UNKNOWN_WEBSOCKET_ERROR
An unknown error occurred on the websocket. You should not see this error.
201
TW_ERROR_INITIALIZING_WEBSOCKET
An error occurred while initializing the websocket. Check your websocket configuration parameters for validity.
202
TW_TIMEOUT_INITIALIZING_WEBSOCKET
A timeout occurred while initializing the websocket. Check the status of the connection to ThingWorx platform.
203
TW_WEBSOCKET_NOT_CONNECTED
The websocket is not connected to ThingWorx platform. The requested operation cannot be performed.
204
TW_ERROR_PARSING_WEBSOCKET_DATA
An error occurred while parsing websocket data. The parser could not break down the data from the websocket.
205
TW_ERROR_READING_FROM_WEBSOCKET
An error occurred while reading data from the websocket. Retry the read operation. If necessary, resend the data.
206
TW_WEBSOCKET_FRAME_TOO_LARGE
The SDK is attempting to send a websocket frame that is too large. The Maximum Frame Size is set when calling twAPI_Initialize and should always be set to the Message Chunk Size (twcfg.message_chunk_size).
207
TW_INVALID_WEBSOCKET_FRAME_TYPE
The type of the frame coming in over the websocket is invalid.
208
TW_WEBSOCKET_MSG_TOO_LARGE
The application is attempting to send a message that has been broken up in to chunks that are too large to fit in a frame. You should not see this error.
209
TW_ERROR_WRITING_TO_WEBSOCKET
An error occurred while writing to the Web socket.
210
TW_INVALID_ACCEPT_KEY
The Accept key sent earlier from ThingWorx platform is not valid.