Disable UDP + DHCP + DNS to reduce the amount of memory usage
Fork of Socket by
Diff: UDPSocket.cpp
- Revision:
- 6:cd2e5559786d
- Parent:
- 5:300e7ad2dc1d
- Child:
- 10:d24738f4ef99
diff -r 300e7ad2dc1d -r cd2e5559786d UDPSocket.cpp --- a/UDPSocket.cpp Thu Jul 26 15:07:32 2012 +0000 +++ b/UDPSocket.cpp Fri Jul 27 13:58:53 2012 +0000 @@ -50,13 +50,13 @@ } // -1 if unsuccessful, else number of bytes written -int UDPSocket::sendTo(UDPPacket& packet, int timeout) { +int UDPSocket::sendTo(UDPPacket& packet, int timeout_ms) { if (_sock_fd < 0) return -1; - if (timeout != 0) { - set_timeout(timeout); - if (wait_writable() != 0) + if (timeout_ms != 0) { + TimeInterval timeout(timeout_ms); + if (wait_writable(timeout) != 0) return -1; } @@ -64,13 +64,13 @@ } // -1 if unsuccessful, else number of bytes received -int UDPSocket::receiveFrom(UDPPacket& packet, int timeout) { +int UDPSocket::receiveFrom(UDPPacket& packet, int timeout_ms) { if (_sock_fd < 0) return -1; - if (timeout != 0) { - set_timeout(timeout); - if (wait_readable() != 0) + if (timeout_ms != 0) { + TimeInterval timeout(timeout_ms); + if (wait_readable(timeout) != 0) return -1; }