Skip to content

Commit

Permalink
switch write(2) to send(2)
Browse files Browse the repository at this point in the history
  • Loading branch information
voutilad committed Jan 5, 2024
1 parent cd1a646 commit 1a51feb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions dws.c
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ ws_write(struct websocket *ws, const void *buf, size_t buflen)
else if (sz == -1)
return -1;
} else {
sz = write(ws->s, _buf, (size_t) _buflen);
sz = send(ws->s, _buf, (size_t) _buflen, 0);
if (sz == -1 && errno == EAGAIN)
continue;
else if (sz == -1)
Expand Down Expand Up @@ -788,8 +788,8 @@ dumb_recv(struct websocket *ws, void *buf, size_t buflen)
*
* Returns:
* 0 on success,
* DWS_ERR_WRITE on failure during write(2),
* DWS_ERR_READ on failure to receive(2) the response,
* DWS_ERR_WRITE on failure during send(2),
* DWS_ERR_READ on failure to recv(2) the response,
* DWS_ERR_INVALID on the response being invalid (i.e. not a PONG)
*/
int
Expand Down

0 comments on commit 1a51feb

Please sign in to comment.