For bug fixes
Fork of MTS-Socket by
Diff: Socket.cpp
- Revision:
- 1:096f484f3ae6
- Child:
- 18:119547e27ff1
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Socket.cpp Mon May 19 12:36:11 2014 -0500 @@ -0,0 +1,20 @@ +#include "Socket.h" +#include <cstring> +#include "Transport.h" + +Socket::Socket() : _blocking(true), _timeout(1500) { + ip = Transport::getInstance(); +} + +void Socket::set_blocking(bool blocking, unsigned int timeout) { + _blocking = blocking; + _timeout = timeout; +} + +int Socket::close() { + return (ip->close()) ? 0 : -1; +} + +Socket::~Socket() { + close(); //Don't want to leak +}