[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdeextragear-3/kdebluetooth/libqobex/qobex
From:       Mathias Fröhlich <Mathias.Froehlich () web ! de>
Date:       2004-06-21 9:16:13
Message-ID: 20040621091613.E3415935B () office ! kde ! org
[Download RAW message or body]

CVS commit by froehlich: 

Support inetd like operation mode.


  M +21 -9     qobexserver.cpp   1.3
  M +6 -0      qobexserver.h   1.2


--- kdeextragear-3/kdebluetooth/libqobex/qobex/qobexserver.cpp  #1.2:1.3
@@ -56,4 +56,11 @@ bool QObexServer::slotRegisterTransport(
   myDebug(( "QObexServer::slotRegisterTransport( ... )" ));
   
+  // Handle where we already got an accepted connection.
+  // Happens in inetd like operation mode.
+  if ( transport->isConnected() ) {
+    allocServerConnection( transport );
+    return true;
+  }
+
   // The usual 50 should be enough ...
   if ( !transport->listen( 50 ) )
@@ -128,12 +135,5 @@ void QObexServer::slotConnectionAccept( 
     return;
 
-  QObexServerConnection* serverConnection
-    = new QObexServerConnection( newtransport, this, "QObexServerConnection" );
-  connect( serverConnection,
-           SIGNAL(signalRequestServerOps(const QByteArray&,QObexServerOps**)),
-           SLOT(slotRequestServerOps(const QByteArray&,QObexServerOps**)) );
-  connect( serverConnection,
-           SIGNAL(signalServerConnectionClosed(QObexServerConnection*)),
-           SLOT(slotServerConnectionClosed(QObexServerConnection*)) );
+  allocServerConnection( newtransport );
 }    
 
@@ -154,4 +154,16 @@ void QObexServer::slotServerConnectionCl
 }
 
+void QObexServer::allocServerConnection( QObexTransport* transport ) {
+  myDebug(( "QObexServer::allocServerConnection( ... )" ));
+
+  QObexServerConnection* serverConnection
+    = new QObexServerConnection( transport, this, "QObexServerConnection" );
+  connect( serverConnection,
+           SIGNAL(signalRequestServerOps(const QByteArray&,QObexServerOps**)),
+           SLOT(slotRequestServerOps(const QByteArray&,QObexServerOps**)) );
+  connect( serverConnection,
+           SIGNAL(signalServerConnectionClosed(QObexServerConnection*)),
+           SLOT(slotServerConnectionClosed(QObexServerConnection*)) );
+}    
 
 #include "qobexserver.moc"

--- kdeextragear-3/kdebluetooth/libqobex/qobex/qobexserver.h  #1.1:1.2
@@ -86,4 +86,10 @@ public slots:
 private:
   /**
+     Allocate a new serverconnection class using the transport given
+     in the argument.
+   */
+  void allocServerConnection( QObexTransport* );
+
+  /**
      Used to send shutdown events.
    */


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic