net: websocket: Use zsock_ API calls
Use zsock_ API calls so that we do not need to enable POSIX_API. Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
This commit is contained in:
parent
de52f8924f
commit
1b07425ead
|
@ -397,7 +397,7 @@ int websocket_connect(int sock, struct websocket_request *wreq,
|
||||||
|
|
||||||
out:
|
out:
|
||||||
if (fd >= 0) {
|
if (fd >= 0) {
|
||||||
(void)close(fd);
|
(void)zsock_close(fd);
|
||||||
}
|
}
|
||||||
|
|
||||||
websocket_context_unref(ctx);
|
websocket_context_unref(ctx);
|
||||||
|
@ -406,7 +406,7 @@ out:
|
||||||
|
|
||||||
int websocket_disconnect(int ws_sock)
|
int websocket_disconnect(int ws_sock)
|
||||||
{
|
{
|
||||||
return close(ws_sock);
|
return zsock_close(ws_sock);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int websocket_interal_disconnect(struct websocket_context *ctx)
|
static int websocket_interal_disconnect(struct websocket_context *ctx)
|
||||||
|
@ -963,8 +963,8 @@ int websocket_recv_msg(int ws_sock, uint8_t *buf, size_t buf_len,
|
||||||
|
|
||||||
ret = wait_rx(ctx->real_sock, timeout_to_ms(&tout));
|
ret = wait_rx(ctx->real_sock, timeout_to_ms(&tout));
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
ret = recv(ctx->real_sock, ctx->recv_buf.buf,
|
ret = zsock_recv(ctx->real_sock, ctx->recv_buf.buf,
|
||||||
ctx->recv_buf.size, MSG_DONTWAIT);
|
ctx->recv_buf.size, MSG_DONTWAIT);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
ret = -errno;
|
ret = -errno;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue