Closed wsky closed 11 years ago
close with status code http://msdn.microsoft.com/zh-cn/library/system.net.httpstatuscode.aspx
int statusCode = this.clientConnection.verifyHeaders();
if (statusCode != 101) {
this.release();
frameConnection.close(statusCode, "invalid header");
return;
}
if (this.manager.isReachMaxConnectionCount()) {
this.release();
frameConnection.close(400, "reach max connections");
return;
}
try {
Message msg = this.clientConnection.parse(data, offset, length);
// deliver to target client
this.manager.getClient(msg.to).pendingMessage(msg);
} catch (MessageTooLongException e) {
e.printStackTrace();
this.frameConnection.close(400, e.getMessage());
} catch (MessageTypeNotSupportException e) {
e.printStackTrace();
this.frameConnection.close(400, e.getMessage());
} catch (NoMessageBufferException e) {
e.printStackTrace();
this.frameConnection.close(400, e.getMessage());
}
websocket status code usage?
what kind of exception should tell client: