{"action":"opened","issue":{"url":"https://api.github.com/repos/NetEase/libpomelo2/issues/47","labels_url":"https://api.github.com/repos/NetEase/libpomelo2/issues/47/labels{/name}","comments_url":"https://api.github.com/repos/NetEase/libpomelo2/issues/47/comments","events_url":"https://api.github.com/repos/NetEase/libpomelo2/issues/47/events","html_url":"https://github.com/NetEase/libpomelo2/issues/47","id":112090773,"number":47,"title":"When can't connect to server, it will assert failed after call pc_client_disconnect.","user":{"login":"zihuyishi","id":3955645,"avatar_url":"https://avatars.githubusercontent.com/u/3955645?v=3","gravatar_id":"","url":"https://api.github.com/users/zihuyishi","html_url":"https://github.com/zihuyishi","followers_url":"https://api.github.com/users/zihuyishi/followers","following_url":"https://api.github.com/users/zihuyishi/following{/other_user}","gists_url":"https://api.github.com/users/zihuyishi/gists{/gist_id}","starred_url":"https://api.github.com/users/zihuyishi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zihuyishi/subscriptions","organizations_url":"https://api.github.com/users/zihuyishi/orgs","repos_url":"https://api.github.com/users/zihuyishi/repos","events_url":"https://api.github.com/users/zihuyishi/events{/privacy}","received_events_url":"https://api.github.com/users/zihuyishi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-10-19T07:54:45Z","updated_at":"2015-10-19T07:54:45Z","closed_at":null,"body":"I use libpomelo2 in an iOS app. I wan't close connection when app enter background. So I write this code when app enter background.\r\n```cpp\r\n    for (int i = 0; i < m_count; ++i) {\r\n        if (m_pomelos[i] != nullptr) {\r\n            pc_client_disconnect(m_pomelos[i]);\r\n            pc_client_rm_ev_handler(m_pomelos[i], m_event_handler);\r\n            pc_client_cleanup(m_pomelos[i]);\r\n            free(m_pomelos[i]);\r\n            m_pomelos[i] = nullptr;\r\n        }\r\n    }\r\n```\r\nSometime our server is offline for test, so the connection will always timeout.\r\nAnd it will assert fail in file [pc_trans.c](https://github.com/NetEase/libpomelo2/blob/master/src/pc_trans.c#L111).\r\n\r\nMaybe there something wrong in my code, so I need some help."}}