summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzeshuai007 <51382517@qq.com>2020-03-24 18:31:37 +0800
committerJens Geyer <jensg@apache.org>2020-09-17 11:30:32 +0200
commit0d6a2d36ea02839313e63421fb1ba4a9de2604ea (patch)
tree75d5b73814ba8ec292e836180851d97df28bd16b
parentdbc4fbf4fe43ba8effd8e4d7cc5c993625cb1d11 (diff)
downloadthrift-0d6a2d36ea02839313e63421fb1ba4a9de2604ea.tar.gz
THRIFT-4272: warnings in glibc library
Client: c_glib Patch: Zezeng Wang This closes #2067
-rw-r--r--lib/c_glib/src/thrift/c_glib/transport/thrift_socket.h26
-rw-r--r--lib/c_glib/src/thrift/c_glib/transport/thrift_ssl_socket.h9
2 files changed, 35 insertions, 0 deletions
diff --git a/lib/c_glib/src/thrift/c_glib/transport/thrift_socket.h b/lib/c_glib/src/thrift/c_glib/transport/thrift_socket.h
index c91f52f18..912929e81 100644
--- a/lib/c_glib/src/thrift/c_glib/transport/thrift_socket.h
+++ b/lib/c_glib/src/thrift/c_glib/transport/thrift_socket.h
@@ -68,6 +68,32 @@ struct _ThriftSocketClass
/* used by THRIFT_TYPE_SOCKET */
GType thrift_socket_get_type (void);
+/**
+ * Check if the socket is open and ready to send and receive
+ * @param transport
+ * @return true if open
+ */
+gboolean
+thrift_socket_is_open (ThriftTransport *transport);
+
+/**
+ * Open connection if required and set the socket to be ready to send and receive
+ * @param transport
+ * @param error
+ * @return true if operation was correct
+ */
+gboolean
+thrift_socket_open (ThriftTransport *transport, GError **error);
+
+/**
+ * Close connection if required
+ * @param transport
+ * @param error
+ * @return true if operation was correct
+ */
+gboolean
+thrift_socket_close (ThriftTransport *transport, GError **error);
+
G_END_DECLS
#endif
diff --git a/lib/c_glib/src/thrift/c_glib/transport/thrift_ssl_socket.h b/lib/c_glib/src/thrift/c_glib/transport/thrift_ssl_socket.h
index 0ca465a0f..dd07c6316 100644
--- a/lib/c_glib/src/thrift/c_glib/transport/thrift_ssl_socket.h
+++ b/lib/c_glib/src/thrift/c_glib/transport/thrift_ssl_socket.h
@@ -188,6 +188,15 @@ thrift_ssl_socket_is_open (ThriftTransport *transport);
gboolean
thrift_ssl_socket_open (ThriftTransport *transport, GError **error);
+/**
+ * Close connection if required
+ * @param transport
+ * @param error
+ * @return true if operation was correct
+ */
+gboolean
+thrift_ssl_socket_close (ThriftTransport *transport, GError **error);
+
/**
* @brief Initialization function