+ }
+ else
+ {
+ int *p_fd_listen;
+
+ p_sys->active = 0;
+ p_fd_listen = net_ListenTCP( p_access, p_sys->p_thread->url.psz_host,
+ p_sys->p_thread->url.i_port );
+ if( p_fd_listen == NULL )
+ {
+ msg_Warn( p_access, "cannot listen to %s port %i",
+ p_sys->p_thread->url.psz_host,
+ p_sys->p_thread->url.i_port );
+ goto error2;
+ }
+
+ do
+ p_sys->p_thread->fd = net_Accept( p_access, p_fd_listen, -1 );
+ while( p_sys->p_thread->fd == -1 );
+ net_ListenClose( p_fd_listen );
+
+ if( rtmp_handshake_passive( p_this, p_sys->p_thread->fd ) < 0 )
+ {
+ msg_Err( p_access, "handshake passive failed");
+ goto error2;
+ }
+ }