AP_HAL: improved constness of Socket API

This commit is contained in:
Staroselskii Georgii 2015-06-15 23:54:08 +03:00 committed by Andrew Tridgell
parent 8f0e7e0693
commit 4411c1fed4
2 changed files with 4 additions and 4 deletions

View File

@ -98,7 +98,7 @@ void SocketAPM::set_blocking(bool blocking)
/*
send some data
*/
ssize_t SocketAPM::send(void *buf, size_t size)
ssize_t SocketAPM::send(const void *buf, size_t size)
{
return ::send(fd, buf, size, 0);
}
@ -106,7 +106,7 @@ ssize_t SocketAPM::send(void *buf, size_t size)
/*
send some data
*/
ssize_t SocketAPM::sendto(void *buf, size_t size, const char *address, uint16_t port)
ssize_t SocketAPM::sendto(const void *buf, size_t size, const char *address, uint16_t port)
{
struct sockaddr_in sockaddr;
make_sockaddr(address, port, sockaddr);

View File

@ -39,8 +39,8 @@ public:
void reuseaddress();
void set_blocking(bool blocking);
ssize_t send(void *pkt, size_t size);
ssize_t sendto(void *buf, size_t size, const char *address, uint16_t port);
ssize_t send(const void *pkt, size_t size);
ssize_t sendto(const void *buf, size_t size, const char *address, uint16_t port);
ssize_t recv(void *pkt, size_t size, uint32_t timeout_ms);
private: