Re #2008: Fixed error "Socket is already connected" when trying to connect to TURN server using the above patch

git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5596 74dad513-b988-da41-8d7b-12977e46ad98
This commit is contained in:
Sauw Ming 2017-05-24 01:02:07 +00:00
parent e0abc07c24
commit f43c106b17
1 changed files with 9 additions and 4 deletions

View File

@ -892,10 +892,15 @@ static void turn_on_state(pj_turn_session *sess,
/* Initiate non-blocking connect */
#if PJ_HAS_TCP
status=pj_activesock_start_connect(turn_sock->active_sock,
turn_sock->pool,
&info.server,
pj_sockaddr_get_len(&info.server));
if (turn_sock->conn_type != PJ_TURN_TP_UDP) {
status=pj_activesock_start_connect(
turn_sock->active_sock,
turn_sock->pool,
&info.server,
pj_sockaddr_get_len(&info.server));
} else {
status = PJ_SUCCESS;
}
if (status == PJ_SUCCESS) {
on_connect_complete(turn_sock->active_sock, PJ_SUCCESS);
} else if (status != PJ_EPENDING) {