reverted HTTPCLient debug back to defaulted off

Dependencies:   HTTPClient-SSL

Fork of MTS-Socket by Keith Ruenheck

Committer:
Mike Fiore
Date:
Mon May 19 12:36:11 2014 -0500
Revision:
1:096f484f3ae6
Parent:
0:eef30dbe1130
Child:
2:ebc6129de4e8
add socket code

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Mike Fiore 1:096f484f3ae6 1 #ifndef TCPSOCKETCONNECTION_H
Mike Fiore 1:096f484f3ae6 2 #define TCPSOCKETCONNECTION_H
Mike Fiore 1:096f484f3ae6 3
Mike Fiore 1:096f484f3ae6 4 #include "mbed.h"
Mike Fiore 1:096f484f3ae6 5 #include "Socket.h"
Mike Fiore 1:096f484f3ae6 6 #include "Endpoint.h"
Mike Fiore 1:096f484f3ae6 7
Mike Fiore 1:096f484f3ae6 8 /**
Mike Fiore 1:096f484f3ae6 9 TCP socket connection
Mike Fiore 1:096f484f3ae6 10 */
Mike Fiore 1:096f484f3ae6 11 class TCPSocketConnection: public Socket, public Endpoint {
Mike Fiore 1:096f484f3ae6 12
Mike Fiore 1:096f484f3ae6 13 public:
Mike Fiore 1:096f484f3ae6 14 /** TCP socket connection
Mike Fiore 1:096f484f3ae6 15 */
Mike Fiore 1:096f484f3ae6 16 TCPSocketConnection();
Mike Fiore 1:096f484f3ae6 17
Mike Fiore 1:096f484f3ae6 18 /** Connects this TCP socket to the server
Mike Fiore 1:096f484f3ae6 19 \param host The host to connect to. It can either be an IP Address or a hostname that will be resolved with DNS.
Mike Fiore 1:096f484f3ae6 20 \param port The host's port to connect to.
Mike Fiore 1:096f484f3ae6 21 \return 0 on success, -1 on failure.
Mike Fiore 1:096f484f3ae6 22 */
Mike Fiore 1:096f484f3ae6 23 int connect(const char* host, const int port);
Mike Fiore 1:096f484f3ae6 24
Mike Fiore 1:096f484f3ae6 25 /** Check if the socket is connected
Mike Fiore 1:096f484f3ae6 26 \return true if connected, false otherwise.
Mike Fiore 1:096f484f3ae6 27 */
Mike Fiore 1:096f484f3ae6 28 bool is_connected(void);
Mike Fiore 1:096f484f3ae6 29
Mike Fiore 1:096f484f3ae6 30 /** Send data to the remote host.
Mike Fiore 1:096f484f3ae6 31 \param data The buffer to send to the host.
Mike Fiore 1:096f484f3ae6 32 \param length The length of the buffer to send.
Mike Fiore 1:096f484f3ae6 33 \return the number of written bytes on success (>=0) or -1 on failure
Mike Fiore 1:096f484f3ae6 34 */
Mike Fiore 1:096f484f3ae6 35 int send(char* data, int length);
Mike Fiore 1:096f484f3ae6 36
Mike Fiore 1:096f484f3ae6 37 /** Send all the data to the remote host.
Mike Fiore 1:096f484f3ae6 38 \param data The buffer to send to the host.
Mike Fiore 1:096f484f3ae6 39 \param length The length of the buffer to send.
Mike Fiore 1:096f484f3ae6 40 \return the number of written bytes on success (>=0) or -1 on failure
Mike Fiore 1:096f484f3ae6 41 */
Mike Fiore 1:096f484f3ae6 42 int send_all(char* data, int length);
Mike Fiore 1:096f484f3ae6 43
Mike Fiore 1:096f484f3ae6 44 /** Receive data from the remote host.
Mike Fiore 1:096f484f3ae6 45 \param data The buffer in which to store the data received from the host.
Mike Fiore 1:096f484f3ae6 46 \param length The maximum length of the buffer.
Mike Fiore 1:096f484f3ae6 47 \return the number of received bytes on success (>=0) or -1 on failure
Mike Fiore 1:096f484f3ae6 48 */
Mike Fiore 1:096f484f3ae6 49 int receive(char* data, int length);
Mike Fiore 1:096f484f3ae6 50
Mike Fiore 1:096f484f3ae6 51 /** Receive all the data from the remote host.
Mike Fiore 1:096f484f3ae6 52 \param data The buffer in which to store the data received from the host.
Mike Fiore 1:096f484f3ae6 53 \param length The maximum length of the buffer.
Mike Fiore 1:096f484f3ae6 54 \return the number of received bytes on success (>=0) or -1 on failure
Mike Fiore 1:096f484f3ae6 55 */
Mike Fiore 1:096f484f3ae6 56 int receive_all(char* data, int length);
Mike Fiore 1:096f484f3ae6 57 };
Mike Fiore 1:096f484f3ae6 58
Mike Fiore 1:096f484f3ae6 59 #endif