Skip to content

Commit

Permalink
back to blocking socket
Browse files Browse the repository at this point in the history
  • Loading branch information
JojoS62 committed Feb 1, 2020
1 parent 9b844e0 commit 1c85c70
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions source/ClientConnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ ClientConnection::~ClientConnection() {
void ClientConnection::start(TCPSocket* socket) {
_socketIsOpen = true;
_socket = socket;
//_socket->set_timeout(10000);
_socket->set_blocking(false);
_socket->set_timeout(10000);
//_socket->set_blocking(false);
_webSocketHandler = nullptr;
_parser.clear();
_request.clear();
Expand All @@ -71,9 +71,9 @@ void ClientConnection::receiveData() {
debug("%s: run receiveData\n", _threadName);
while(_socketIsOpen) {
nsapi_size_or_error_t recv_ret;
// if (!_isWebSocket) {
// _socket->set_timeout(10000); // timeout to defend connections without sending data
// }
if (!_isWebSocket) {
_socket->set_timeout(10000); // timeout to defend connections without sending data
}
while ((recv_ret = _socket->recv(_recv_buffer, HTTP_RECEIVE_BUFFER_SIZE)) > 0) {
if (_isWebSocket) {
break; // Websocket must not be parsed
Expand Down

0 comments on commit 1c85c70

Please sign in to comment.