@ -381,7 +381,7 @@ void Webcam::processMessage(const Message& message)
if ( ! port1 . isNull ( ) )
if ( ! port1 . isNull ( ) )
{
{
kdDebug ( 14140 ) < < k_funcinfo < < " trying to connect on " < < ip < < " : " < < port1 < < endl ;
kdDebug ( 14140 ) < < k_funcinfo < < " trying to connect on " < < ip < < " : " < < port1 < < endl ;
KBufferedSocket * sock = new K BufferedSocket( ip , port1 , this ) ;
TDEBufferedSocket * sock = new TDE BufferedSocket( ip , port1 , this ) ;
m_allSockets . append ( sock ) ;
m_allSockets . append ( sock ) ;
TQObject : : connect ( sock , TQT_SIGNAL ( connected ( const KResolverEntry & ) ) , this , TQT_SLOT ( slotSocketConnected ( ) ) ) ;
TQObject : : connect ( sock , TQT_SIGNAL ( connected ( const KResolverEntry & ) ) , this , TQT_SLOT ( slotSocketConnected ( ) ) ) ;
TQObject : : connect ( sock , TQT_SIGNAL ( gotError ( int ) ) , this , TQT_SLOT ( slotSocketError ( int ) ) ) ;
TQObject : : connect ( sock , TQT_SIGNAL ( gotError ( int ) ) , this , TQT_SLOT ( slotSocketError ( int ) ) ) ;
@ -391,7 +391,7 @@ void Webcam::processMessage(const Message& message)
if ( ! port2 . isNull ( ) )
if ( ! port2 . isNull ( ) )
{
{
kdDebug ( 14140 ) < < k_funcinfo < < " trying to connect on " < < ip < < " : " < < port2 < < endl ;
kdDebug ( 14140 ) < < k_funcinfo < < " trying to connect on " < < ip < < " : " < < port2 < < endl ;
KBufferedSocket * sock = new K BufferedSocket( ip , port2 , this ) ;
TDEBufferedSocket * sock = new TDE BufferedSocket( ip , port2 , this ) ;
m_allSockets . append ( sock ) ;
m_allSockets . append ( sock ) ;
TQObject : : connect ( sock , TQT_SIGNAL ( connected ( const KResolverEntry & ) ) , this , TQT_SLOT ( slotSocketConnected ( ) ) ) ;
TQObject : : connect ( sock , TQT_SIGNAL ( connected ( const KResolverEntry & ) ) , this , TQT_SLOT ( slotSocketConnected ( ) ) ) ;
TQObject : : connect ( sock , TQT_SIGNAL ( gotError ( int ) ) , this , TQT_SLOT ( slotSocketError ( int ) ) ) ;
TQObject : : connect ( sock , TQT_SIGNAL ( gotError ( int ) ) , this , TQT_SLOT ( slotSocketError ( int ) ) ) ;
@ -400,17 +400,17 @@ void Webcam::processMessage(const Message& message)
if ( ! port3 . isNull ( ) )
if ( ! port3 . isNull ( ) )
{
{
kdDebug ( 14140 ) < < k_funcinfo < < " trying to connect on " < < ip < < " : " < < port3 < < endl ;
kdDebug ( 14140 ) < < k_funcinfo < < " trying to connect on " < < ip < < " : " < < port3 < < endl ;
KBufferedSocket * sock = new K BufferedSocket( ip , port3 , this ) ;
TDEBufferedSocket * sock = new TDE BufferedSocket( ip , port3 , this ) ;
m_allSockets . append ( sock ) ;
m_allSockets . append ( sock ) ;
TQObject : : connect ( sock , TQT_SIGNAL ( connected ( const KResolverEntry & ) ) , this , TQT_SLOT ( slotSocketConnected ( ) ) ) ;
TQObject : : connect ( sock , TQT_SIGNAL ( connected ( const KResolverEntry & ) ) , this , TQT_SLOT ( slotSocketConnected ( ) ) ) ;
TQObject : : connect ( sock , TQT_SIGNAL ( gotError ( int ) ) , this , TQT_SLOT ( slotSocketError ( int ) ) ) ;
TQObject : : connect ( sock , TQT_SIGNAL ( gotError ( int ) ) , this , TQT_SLOT ( slotSocketError ( int ) ) ) ;
sock - > connect ( ip , port3 ) ;
sock - > connect ( ip , port3 ) ;
}
}
}
}
TQValueList < K BufferedSocket* > : : iterator it ;
TQValueList < TDE BufferedSocket* > : : iterator it ;
for ( it = m_allSockets . begin ( ) ; it ! = m_allSockets . end ( ) ; + + it )
for ( it = m_allSockets . begin ( ) ; it ! = m_allSockets . end ( ) ; + + it )
{
{
K BufferedSocket * sock = ( * it ) ;
TDE BufferedSocket * sock = ( * it ) ;
//sock->enableRead( false );
//sock->enableRead( false );
kdDebug ( 14140 ) < < k_funcinfo < < " connect to " < < sock < < " - " < < sock - > peerAddress ( ) . toString ( ) < < " ; " < < sock - > localAddress ( ) . toString ( ) < < endl ;
kdDebug ( 14140 ) < < k_funcinfo < < " connect to " < < sock < < " - " < < sock - > peerAddress ( ) . toString ( ) < < " ; " < < sock - > localAddress ( ) . toString ( ) < < endl ;
@ -557,7 +557,7 @@ void Webcam::slotSocketConnected()
{
{
kdDebug ( 14140 ) < < k_funcinfo < < " ########################## " < < endl ;
kdDebug ( 14140 ) < < k_funcinfo < < " ########################## " < < endl ;
m_webcamSocket = const_cast < KBufferedSocket* > ( static_cast < const K BufferedSocket* > ( sender ( ) ) ) ;
m_webcamSocket = const_cast < TDEBufferedSocket* > ( static_cast < const TDE BufferedSocket* > ( sender ( ) ) ) ;
if ( ! m_webcamSocket )
if ( ! m_webcamSocket )
return ;
return ;
@ -585,7 +585,7 @@ void Webcam::slotSocketConnected()
void Webcam : : slotAccept ( )
void Webcam : : slotAccept ( )
{
{
// Try to accept an incoming connection from the sending client.
// Try to accept an incoming connection from the sending client.
m_webcamSocket = static_cast < K BufferedSocket* > ( m_listener - > accept ( ) ) ;
m_webcamSocket = static_cast < TDE BufferedSocket* > ( m_listener - > accept ( ) ) ;
if ( ! m_webcamSocket )
if ( ! m_webcamSocket )
{
{
// NOTE If direct connection fails, the sending
// NOTE If direct connection fails, the sending
@ -620,7 +620,7 @@ void Webcam::slotAccept()
void Webcam : : slotSocketRead ( )
void Webcam : : slotSocketRead ( )
{
{
m_webcamSocket = const_cast < KBufferedSocket* > ( static_cast < const K BufferedSocket* > ( sender ( ) ) ) ;
m_webcamSocket = const_cast < TDEBufferedSocket* > ( static_cast < const TDE BufferedSocket* > ( sender ( ) ) ) ;
uint available = m_webcamSocket - > bytesAvailable ( ) ;
uint available = m_webcamSocket - > bytesAvailable ( ) ;
kdDebug ( 14140 ) < < k_funcinfo < < m_webcamSocket < < " ############# " < < available < < " bytes available. " < < endl ;
kdDebug ( 14140 ) < < k_funcinfo < < m_webcamSocket < < " ############# " < < available < < " bytes available. " < < endl ;
@ -786,7 +786,7 @@ void Webcam::slotSocketClosed()
if ( ! m_dispatcher ) //we are in this destructor
if ( ! m_dispatcher ) //we are in this destructor
return ;
return ;
KBufferedSocket * m_webcamSocket = const_cast < KBufferedSocket * > ( static_cast < const K BufferedSocket* > ( sender ( ) ) ) ;
TDEBufferedSocket * m_webcamSocket = const_cast < TDEBufferedSocket * > ( static_cast < const TDE BufferedSocket* > ( sender ( ) ) ) ;
kdDebug ( 14140 ) < < k_funcinfo < < m_webcamSocket < < endl ;
kdDebug ( 14140 ) < < k_funcinfo < < m_webcamSocket < < endl ;
@ -804,7 +804,7 @@ void Webcam::slotSocketClosed()
void Webcam : : slotSocketError ( int errorCode )
void Webcam : : slotSocketError ( int errorCode )
{
{
KBufferedSocket * socket = const_cast < KBufferedSocket * > ( static_cast < const K BufferedSocket* > ( sender ( ) ) ) ;
TDEBufferedSocket * socket = const_cast < TDEBufferedSocket * > ( static_cast < const TDE BufferedSocket* > ( sender ( ) ) ) ;
kdDebug ( 14140 ) < < k_funcinfo < < socket < < " - " < < errorCode < < " : " < < socket - > TDESocketBase : : errorString ( ) < < endl ;
kdDebug ( 14140 ) < < k_funcinfo < < socket < < " - " < < errorCode < < " : " < < socket - > TDESocketBase : : errorString ( ) < < endl ;
//sendBYEMessage();
//sendBYEMessage();
}
}
@ -815,10 +815,10 @@ void Webcam::closeAllOtherSockets()
delete m_listener ;
delete m_listener ;
m_listener = 0l ;
m_listener = 0l ;
TQValueList < K BufferedSocket* > : : iterator it ;
TQValueList < TDE BufferedSocket* > : : iterator it ;
for ( it = m_allSockets . begin ( ) ; it ! = m_allSockets . end ( ) ; + + it )
for ( it = m_allSockets . begin ( ) ; it ! = m_allSockets . end ( ) ; + + it )
{
{
K BufferedSocket * sock = ( * it ) ;
TDE BufferedSocket * sock = ( * it ) ;
if ( sock ! = m_webcamSocket )
if ( sock ! = m_webcamSocket )
delete sock ;
delete sock ;
}
}