qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From astitc...@apache.org
Subject svn commit: r680833 - in /incubator/qpid/trunk/qpid/cpp/src/qpid: client/ConnectionImpl.cpp client/Connector.cpp client/Connector.h sys/Socket.h sys/posix/Socket.cpp sys/posix/Thread.h
Date Tue, 29 Jul 2008 20:27:29 GMT
Author: astitcher
Date: Tue Jul 29 13:27:28 2008
New Revision: 680833

URL: http://svn.apache.org/viewvc?rev=680833&view=rev
Log:
Removed unused functions
Removed unused Thread and Socket functions
- These functions also cause problems with Solaris compilations
Remove unused client connector functionality

Modified:
    incubator/qpid/trunk/qpid/cpp/src/qpid/client/ConnectionImpl.cpp
    incubator/qpid/trunk/qpid/cpp/src/qpid/client/Connector.cpp
    incubator/qpid/trunk/qpid/cpp/src/qpid/client/Connector.h
    incubator/qpid/trunk/qpid/cpp/src/qpid/sys/Socket.h
    incubator/qpid/trunk/qpid/cpp/src/qpid/sys/posix/Socket.cpp
    incubator/qpid/trunk/qpid/cpp/src/qpid/sys/posix/Thread.h

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/client/ConnectionImpl.cpp
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/client/ConnectionImpl.cpp?rev=680833&r1=680832&r2=680833&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/client/ConnectionImpl.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/client/ConnectionImpl.cpp Tue Jul 29 13:27:28 2008
@@ -48,7 +48,6 @@
     handler.onClose = boost::bind(&ConnectionImpl::closed, this,
                                   NORMAL, std::string());
     connector->setInputHandler(&handler);
-    connector->setTimeoutHandler(this);
     connector->setShutdownHandler(this);
 
     //only set error handler once  open

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/client/Connector.cpp
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/client/Connector.cpp?rev=680833&r1=680832&r2=680833&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/client/Connector.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/client/Connector.cpp Tue Jul 29 13:27:28 2008
@@ -133,55 +133,6 @@
         shutdownHandler->shutdown();
 }
 
-// TODO: astitcher 20070908: This version of the code can never time out, so the idle processing
-// can never be called. The timeut processing needs to be added into the underlying Dispatcher
code
-//
-// TODO: astitcher 20070908: EOF is dealt with separately now via a callback to eof
-void Connector::checkIdle(ssize_t status){
-    if(timeoutHandler){
-        AbsTime t = now();
-        if(status == Socket::SOCKET_TIMEOUT) {
-            if(idleIn && (Duration(lastIn, t) > idleIn)){
-                timeoutHandler->idleIn();
-            }
-        }
-        else if(status == 0 || status == Socket::SOCKET_EOF) {
-            handleClosed();
-        }
-        else {
-            lastIn = t;
-        }
-        if(idleOut && (Duration(lastOut, t) > idleOut)){
-            timeoutHandler->idleOut();
-        }
-    }
-}
-
-void Connector::setReadTimeout(uint16_t t){
-    idleIn = t * TIME_SEC;//t is in secs
-    if(idleIn && (!timeout || idleIn < timeout)){
-        timeout = idleIn;
-        setSocketTimeout();
-    }
-
-}
-
-void Connector::setWriteTimeout(uint16_t t){
-    idleOut = t * TIME_SEC;//t is in secs
-    if(idleOut && (!timeout || idleOut < timeout)){
-        timeout = idleOut;
-        setSocketTimeout();
-    }
-}
-
-void Connector::setSocketTimeout(){
-    socket.setTimeout(timeout);
-}
-
-void Connector::setTimeoutHandler(TimeoutHandler* handler){
-    timeoutHandler = handler;
-}
-
 struct Connector::Buff : public AsynchIO::BufferBase {
     Buff(size_t size) : AsynchIO::BufferBase(new char[size], size) {}    
     ~Buff() { delete [] bytes;}

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/client/Connector.h
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/client/Connector.h?rev=680833&r1=680832&r2=680833&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/client/Connector.h (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/client/Connector.h Tue Jul 29 13:27:28 2008
@@ -116,9 +116,6 @@
     sys::AsynchIO* aio;
     boost::shared_ptr<sys::Poller> poller;
 
-    void checkIdle(ssize_t status);
-    void setSocketTimeout();
-
     void run();
     void handleClosed();
     bool closeInternal();
@@ -141,13 +138,10 @@
     virtual void init();
     virtual void close();
     virtual void setInputHandler(framing::InputHandler* handler);
-    virtual void setTimeoutHandler(sys::TimeoutHandler* handler);
     virtual void setShutdownHandler(sys::ShutdownHandler* handler);
     virtual sys::ShutdownHandler* getShutdownHandler() { return shutdownHandler; }
     virtual framing::OutputHandler* getOutputHandler();
     virtual void send(framing::AMQFrame& frame);
-    virtual void setReadTimeout(uint16_t timeout);
-    virtual void setWriteTimeout(uint16_t timeout);
     const std::string& getIdentifier() const { return identifier; }
 };
 

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/sys/Socket.h
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/sys/Socket.h?rev=680833&r1=680832&r2=680833&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/sys/Socket.h (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/sys/Socket.h Tue Jul 29 13:27:28 2008
@@ -21,6 +21,7 @@
  * under the License.
  *
  */
+
 #include "IOHandle.h"
 
 #include <string>
@@ -51,17 +52,6 @@
 
     void close() const;
 
-    enum { SOCKET_TIMEOUT=-2, SOCKET_EOF=-3 } ErrorCode;
-
-    /** Returns bytes sent or an ErrorCode value < 0. */
-    ssize_t send(const void* data, size_t size) const;
-
-    /**
-     * Returns bytes received, an ErrorCode value < 0 or 0
-     * if the connection closed in an orderly manner.
-     */
-    ssize_t recv(void* data, size_t size) const;
-
     /** Bind to a port and start listening.
      *@param port 0 means choose an available port.
      *@param backlog maximum number of pending connections.

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/sys/posix/Socket.cpp
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/sys/posix/Socket.cpp?rev=680833&r1=680832&r2=680833&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/sys/posix/Socket.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/sys/posix/Socket.cpp Tue Jul 29 13:27:28 2008
@@ -167,31 +167,6 @@
     socket = -1;
 }
 
-ssize_t
-Socket::send(const void* data, size_t size) const
-{
-    const int& socket = impl->fd;
-    ssize_t sent = ::send(socket, data, size, 0);
-    if (sent < 0) {
-        if (errno == ECONNRESET) return SOCKET_EOF;
-        if (errno == ETIMEDOUT) return SOCKET_TIMEOUT;
-        throw QPID_POSIX_ERROR(errno);
-    }
-    return sent;
-}
-
-ssize_t
-Socket::recv(void* data, size_t size) const
-{
-    const int& socket = impl->fd;
-    ssize_t received = ::recv(socket, data, size, 0);
-    if (received < 0) {
-        if (errno == ETIMEDOUT) return SOCKET_TIMEOUT;
-        throw QPID_POSIX_ERROR(errno);
-    }
-    return received;
-}
-
 int Socket::listen(uint16_t port, int backlog) const
 {
     const int& socket = impl->fd;

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/sys/posix/Thread.h
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/sys/posix/Thread.h?rev=680833&r1=680832&r2=680833&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/sys/posix/Thread.h (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/sys/posix/Thread.h Tue Jul 29 13:27:28 2008
@@ -22,6 +22,10 @@
  *
  */
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #include "check.h"
 #include <pthread.h>
 
@@ -40,8 +44,6 @@
      */
     static unsigned long logId() { return current().id(); }
 
-    inline static void yield();
-
     inline Thread();
     inline explicit Thread(qpid::sys::Runnable*);
     inline explicit Thread(qpid::sys::Runnable&);
@@ -82,11 +84,5 @@
     return Thread(pthread_self());
 }
 
-void Thread::yield() 
-{
-    QPID_POSIX_ASSERT_THROW_IF(pthread_yield());
-}
-
-
 }}
 #endif  /*!_sys_posix_Thread_h*/



Mime
View raw message