CAAdapterAcceptThreadContext_t *ctx = (CAAdapterAcceptThreadContext_t *) data;
- // it should be initialized for restart accept thread
- oc_mutex_lock(g_mutexAcceptServer);
- g_stopAccept = false;
- oc_mutex_unlock(g_mutexAcceptServer);
-
while (true != *(ctx->stopFlag))
{
// when BT state is changed with Off. its thread will be stopped
}
oc_mutex_unlock(g_mutexStartServerState);
+ // it should be initialized for restart accept thread
+ oc_mutex_lock(g_mutexAcceptServer);
+ OIC_LOG(DEBUG, TAG, "accept flag is set false");
+ g_stopAccept = false;
+ oc_mutex_unlock(g_mutexAcceptServer);
+
CAResult_t res = CAEDRServerStartAcceptThread();
if (CA_STATUS_OK == res)
{
CAEDRStopReceiveThread();
oc_mutex_lock(g_mutexAcceptServer);
+ OIC_LOG(DEBUG, TAG, "accept flag is set true");
g_stopAccept = true;
oc_mutex_unlock(g_mutexAcceptServer);
{
OIC_LOG(DEBUG, TAG, "CAEDRNativeAccept - IN");
- if (NULL != serverSocketObject)
+ if (NULL != serverSocketObject && false == g_stopAccept)
{
jmethodID jni_mid_accept = CAGetJNIMethodID(env, CLASSPATH_BT_SERVER_SOCKET,
"accept",
*/
void CAEDRNatvieCloseServerTask(JNIEnv* env)
{
+ OIC_LOG(DEBUG, TAG, "CAEDRNatvieCloseServerTask");
if (g_serverSocket)
{
OIC_LOG(DEBUG, TAG, "Accept Resource will be close");