Comments
Patch
@@ -329,3 +329,16 @@
}
return length;
}
+
+/*
+ * The channel for the next chunk of data.
+ * */
+char hg_next_channel(hg_handle *handle)
+{
+ if(!handle) {
+ errno = EINVAL;
+ return -1;
+ }
+
+ return handle->next_header.channel;
+}
@@ -136,4 +136,20 @@
* */
int hg_rawwrite(hg_handle *handle, const char *buffer, size_t sizebuff);
+/**
+ * \brief Reading the channel for the next chunk of data.
+ *
+ * Before you read or write data, you will want to know what kind of data is
+ * server waiting to send or receive.
+ * This function will return the next channel for the connection established
+ * by the handle.
+ * \param handle The handle of the connection, wherewith I want to communicate
+ * \retval 0 if successful
+ * \retval -1 to indicate an error, with errno set appropriately.
+ *
+ * errno can be:
+ * - EINVAL - Invalid argument (handle it's set to a null pointer)
+ * */
+char hg_next_channel(hg_handle *handle);
+
#endif