replace : iotivity -> iotivity-sec
[platform/upstream/iotivity.git] / resource / csdk / connectivity / inc / catcpadapter.h
index cb2a740..536f8f6 100644 (file)
@@ -64,10 +64,11 @@ typedef struct
     unsigned char* data;                /**< received data from remote device */
     size_t len;                         /**< received data length */
     size_t totalLen;                    /**< total coap data length required to receive */
-    unsigned char tlsdata[18437];     /**< tls data(rfc5246: TLSCiphertext max (2^14+2048+5)) */
-    size_t tlsLen;                         /**< received tls data length */
+    unsigned char tlsdata[18437];       /**< tls data(rfc5246: TLSCiphertext max (2^14+2048+5)) */
+    size_t tlsLen;                      /**< received tls data length */
     CAProtocol_t protocol;              /**< application-level protocol */
     CATCPConnectionState_t state;       /**< current tcp session state */
+    bool isClient;                      /**< Host Mode of Operation. */
 } CATCPSessionInfo_t;
 
 /**
@@ -99,6 +100,16 @@ CAResult_t CAInitializeTCP(CARegisterConnectivityCallback registerCallback,
 CAResult_t CAStartTCP();
 
 /**
+ * Disconnect TCP session.
+ * When there is no transmission for a long time.
+ * Some carrier Vendor is blocking data.
+ * Thur, TCP Session is cleaned through this function.
+ * @param[in]   endpoint       Remote Endpoint information (like ipaddress,
+ *                             port)
+ */
+CAResult_t CATCPDisconnectSession(const CAEndpoint_t *endpoint);
+
+/**
  * Start listening server for receiving connect requests.
  * Transport Specific Behavior:
  * TCP Starts Listening Server on a particular interface and prefixed port