In net module fixed types for net_send/recv funcs.
This commit is contained in:
parent
f9a660a634
commit
297d3c95c3
@ -113,14 +113,14 @@ bool net_set_timeout(net_t *const n, int usec) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
ssize_t net_send(net_t *const n, const char *const buf, int buf_len) {
|
ssize_t net_send(const net_t *const n, const char *const buf, const size_t buf_len) {
|
||||||
if (n->fd == -1 || n->raddr.sa_family == AF_UNSPEC)
|
if (n->fd == -1 || n->raddr.sa_family == AF_UNSPEC)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return sendto(n->fd, buf, buf_len, 0, &n->raddr, sizeof(n->raddr));
|
return sendto(n->fd, buf, buf_len, 0, &n->raddr, sizeof(n->raddr));
|
||||||
}
|
}
|
||||||
|
|
||||||
ssize_t net_recv(net_t *const n, void *const buf, size_t buf_len) {
|
ssize_t net_recv(net_t *const n, void *const buf, const size_t buf_len) {
|
||||||
if (n->fd == -1)
|
if (n->fd == -1)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ void net_destroy(net_t *n);
|
|||||||
|
|
||||||
bool net_set_timeout(net_t *const n, int usec);
|
bool net_set_timeout(net_t *const n, int usec);
|
||||||
|
|
||||||
ssize_t net_send(net_t *const n, const char *const buf, int buf_len);
|
ssize_t net_send(const net_t *const n, const char *const buf, const size_t buf_len);
|
||||||
ssize_t net_recv(net_t *const n, void *const buf, size_t buf_len);
|
ssize_t net_recv(net_t *const n, void *const buf, const size_t buf_len);
|
||||||
|
|
||||||
#endif /* _NET_H_ */
|
#endif /* _NET_H_ */
|
||||||
|
Loading…
Reference in New Issue
Block a user