Socket library for MTS Socket Modem Arduino Shield devices from Multi-Tech Systems

Dependencies:   HTTPClient-SSL

Dependents:   mtsas mtsas mtsas mtsas_lat3

Socket.cpp

Committer:
mfiore
Date:
2015-06-25
Revision:
43:2b78cadc0894
Parent:
19:f9a0041c4501

File content as of revision 43:2b78cadc0894:

#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(bool shutdown) {
    return (ip->close(shutdown)) ? 0 : -1;
}

Socket::~Socket() {
    close(true); //Don't want to leak
}