mbed socket API
Dependents: EthernetInterface EthernetInterface_RSF EthernetInterface EthernetInterface ... more
Deprecated
This is an mbed 2 sockets library. For mbed 5, network sockets have been revised to better support additional network stacks and thread safety here.
Diff: TCPSocketConnection.h
- Revision:
- 11:3d83c348fb8b
- Parent:
- 10:d24738f4ef99
- Child:
- 12:8867c9da3b08
--- a/TCPSocketConnection.h Tue Jul 31 11:50:55 2012 +0000
+++ b/TCPSocketConnection.h Wed Aug 01 13:02:32 2012 +0000
@@ -33,8 +33,6 @@
*/
TCPSocketConnection();
- ~TCPSocketConnection();
-
/** Connects this TCP socket to the server
\param host The host to connect to. It can either be an IP Address or a hostname that will be resolved with DNS.
\param port The host's port to connect to.
@@ -42,6 +40,11 @@
*/
int connect(const char* host, const int port);
+ /** Check if the socket is connected
+ \return true if connected, false otherwise.
+ */
+ bool is_connected(void);
+
/** Send data to the remote host.
\param data The buffer to send to the host.
\param length The length of the buffer to send.
@@ -71,7 +74,7 @@
int receive_all(char* data, int length);
private:
- bool _closedByRemoteHost;
+ bool _is_connected;
};
mbed official


