Nigel Rantor / azure_c_shared_utility

Fork of azure_c_shared_utility by Azure IoT

Revision:
0:fa2de1b79154
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tcpsocketconnection_c.h	Fri Apr 08 12:01:36 2016 -0700
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+#ifndef TCPSOCKETCONNECTION_C_H
+#define TCPSOCKETCONNECTION_C_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+	typedef void* TCPSOCKETCONNECTION_HANDLE;
+
+	TCPSOCKETCONNECTION_HANDLE tcpsocketconnection_create(void);
+	void tcpsocketconnection_set_blocking(TCPSOCKETCONNECTION_HANDLE tcpSocketConnectionHandle, bool blocking, unsigned int timeout);
+	void tcpsocketconnection_destroy(TCPSOCKETCONNECTION_HANDLE tcpSocketConnectionHandle);
+	int tcpsocketconnection_connect(TCPSOCKETCONNECTION_HANDLE tcpSocketConnectionHandle, const char* host, const int port);
+	bool tcpsocketconnection_is_connected(TCPSOCKETCONNECTION_HANDLE tcpSocketConnectionHandle);
+	void tcpsocketconnection_close(TCPSOCKETCONNECTION_HANDLE tcpSocketConnectionHandle);
+	int tcpsocketconnection_send(TCPSOCKETCONNECTION_HANDLE tcpSocketConnectionHandle, const char* data, int length);
+	int tcpsocketconnection_send_all(TCPSOCKETCONNECTION_HANDLE tcpSocketConnectionHandle, const char* data, int length);
+	int tcpsocketconnection_receive(TCPSOCKETCONNECTION_HANDLE tcpSocketConnectionHandle, char* data, int length);
+	int tcpsocketconnection_receive_all(TCPSOCKETCONNECTION_HANDLE tcpSocketConnectionHandle, char* data, int length);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* TCPSOCKETCONNECTION_C_H */