From f973d1498dba6ca0b33711ddce66b3bc3e6b59a2 Mon Sep 17 00:00:00 2001 From: XinyuHou Date: Mon, 12 Jan 2015 10:33:29 +0000 Subject: [PATCH] dropped prefix C --- src/lib/ipc/IpcClient.h | 2 +- src/lib/net/TCPListenSocket.cpp | 2 +- src/lib/net/TCPSocket.cpp | 60 ++++++++++++------------ src/lib/net/TCPSocket.h | 8 ++-- src/lib/net/TCPSocketFactory.cpp | 12 ++--- src/lib/net/TCPSocketFactory.h | 6 +-- src/lib/synergy/ClientApp.cpp | 2 +- src/lib/synergy/ServerApp.cpp | 2 +- src/test/integtests/net/NetworkTests.cpp | 16 +++---- 9 files changed, 55 insertions(+), 55 deletions(-) diff --git a/src/lib/ipc/IpcClient.h b/src/lib/ipc/IpcClient.h index d990a35e..f9b1c9ab 100644 --- a/src/lib/ipc/IpcClient.h +++ b/src/lib/ipc/IpcClient.h @@ -58,7 +58,7 @@ private: private: NetworkAddress m_serverAddress; - CTCPSocket m_socket; + TCPSocket m_socket; IpcServerProxy* m_server; IEventQueue* m_events; }; diff --git a/src/lib/net/TCPListenSocket.cpp b/src/lib/net/TCPListenSocket.cpp index bf6fa91a..cdbd73c4 100644 --- a/src/lib/net/TCPListenSocket.cpp +++ b/src/lib/net/TCPListenSocket.cpp @@ -110,7 +110,7 @@ TCPListenSocket::accept() { IDataSocket* socket = NULL; try { - socket = new CTCPSocket(m_events, m_socketMultiplexer, ARCH->acceptSocket(m_socket, NULL)); + socket = new TCPSocket(m_events, m_socketMultiplexer, ARCH->acceptSocket(m_socket, NULL)); if (socket != NULL) { m_socketMultiplexer->addSocket(this, new TSocketMultiplexerMethodJob( diff --git a/src/lib/net/TCPSocket.cpp b/src/lib/net/TCPSocket.cpp index ad8d5510..2b2fd1cf 100644 --- a/src/lib/net/TCPSocket.cpp +++ b/src/lib/net/TCPSocket.cpp @@ -34,10 +34,10 @@ #include // -// CTCPSocket +// TCPSocket // -CTCPSocket::CTCPSocket(IEventQueue* events, SocketMultiplexer* socketMultiplexer) : +TCPSocket::TCPSocket(IEventQueue* events, SocketMultiplexer* socketMultiplexer) : IDataSocket(events), m_mutex(), m_flushed(&m_mutex, true), @@ -54,7 +54,7 @@ CTCPSocket::CTCPSocket(IEventQueue* events, SocketMultiplexer* socketMultiplexer init(); } -CTCPSocket::CTCPSocket(IEventQueue* events, SocketMultiplexer* socketMultiplexer, ArchSocket socket) : +TCPSocket::TCPSocket(IEventQueue* events, SocketMultiplexer* socketMultiplexer, ArchSocket socket) : IDataSocket(events), m_mutex(), m_socket(socket), @@ -70,7 +70,7 @@ CTCPSocket::CTCPSocket(IEventQueue* events, SocketMultiplexer* socketMultiplexer setJob(newJob()); } -CTCPSocket::~CTCPSocket() +TCPSocket::~TCPSocket() { try { close(); @@ -81,7 +81,7 @@ CTCPSocket::~CTCPSocket() } void -CTCPSocket::bind(const NetworkAddress& addr) +TCPSocket::bind(const NetworkAddress& addr) { try { ARCH->bindSocket(m_socket, addr.getAddress()); @@ -95,7 +95,7 @@ CTCPSocket::bind(const NetworkAddress& addr) } void -CTCPSocket::close() +TCPSocket::close() { // remove ourself from the multiplexer setJob(NULL); @@ -123,13 +123,13 @@ CTCPSocket::close() } void* -CTCPSocket::getEventTarget() const +TCPSocket::getEventTarget() const { return const_cast(reinterpret_cast(this)); } UInt32 -CTCPSocket::read(void* buffer, UInt32 n) +TCPSocket::read(void* buffer, UInt32 n) { // copy data directly from our input buffer Lock lock(&m_mutex); @@ -152,7 +152,7 @@ CTCPSocket::read(void* buffer, UInt32 n) } void -CTCPSocket::write(const void* buffer, UInt32 n) +TCPSocket::write(const void* buffer, UInt32 n) { bool wasEmpty; { @@ -184,7 +184,7 @@ CTCPSocket::write(const void* buffer, UInt32 n) } void -CTCPSocket::flush() +TCPSocket::flush() { Lock lock(&m_mutex); while (m_flushed == false) { @@ -193,7 +193,7 @@ CTCPSocket::flush() } void -CTCPSocket::shutdownInput() +TCPSocket::shutdownInput() { bool useNewJob = false; { @@ -220,7 +220,7 @@ CTCPSocket::shutdownInput() } void -CTCPSocket::shutdownOutput() +TCPSocket::shutdownOutput() { bool useNewJob = false; { @@ -247,21 +247,21 @@ CTCPSocket::shutdownOutput() } bool -CTCPSocket::isReady() const +TCPSocket::isReady() const { Lock lock(&m_mutex); return (m_inputBuffer.getSize() > 0); } UInt32 -CTCPSocket::getSize() const +TCPSocket::getSize() const { Lock lock(&m_mutex); return m_inputBuffer.getSize(); } void -CTCPSocket::connect(const NetworkAddress& addr) +TCPSocket::connect(const NetworkAddress& addr) { { Lock lock(&m_mutex); @@ -290,7 +290,7 @@ CTCPSocket::connect(const NetworkAddress& addr) } void -CTCPSocket::init() +TCPSocket::init() { // default state m_connected = false; @@ -316,7 +316,7 @@ CTCPSocket::init() } void -CTCPSocket::setJob(ISocketMultiplexerJob* job) +TCPSocket::setJob(ISocketMultiplexerJob* job) { // multiplexer will delete the old job if (job == NULL) { @@ -328,7 +328,7 @@ CTCPSocket::setJob(ISocketMultiplexerJob* job) } ISocketMultiplexerJob* -CTCPSocket::newJob() +TCPSocket::newJob() { // note -- must have m_mutex locked on entry @@ -340,23 +340,23 @@ CTCPSocket::newJob() if (!(m_readable || m_writable)) { return NULL; } - return new TSocketMultiplexerMethodJob( - this, &CTCPSocket::serviceConnecting, + return new TSocketMultiplexerMethodJob( + this, &TCPSocket::serviceConnecting, m_socket, m_readable, m_writable); } else { if (!(m_readable || (m_writable && (m_outputBuffer.getSize() > 0)))) { return NULL; } - return new TSocketMultiplexerMethodJob( - this, &CTCPSocket::serviceConnected, + return new TSocketMultiplexerMethodJob( + this, &TCPSocket::serviceConnected, m_socket, m_readable, m_writable && (m_outputBuffer.getSize() > 0)); } } void -CTCPSocket::sendConnectionFailedEvent(const char* msg) +TCPSocket::sendConnectionFailedEvent(const char* msg) { ConnectionFailedInfo* info = new ConnectionFailedInfo(msg); m_events->addEvent(Event(m_events->forIDataSocket().connectionFailed(), @@ -364,13 +364,13 @@ CTCPSocket::sendConnectionFailedEvent(const char* msg) } void -CTCPSocket::sendEvent(Event::Type type) +TCPSocket::sendEvent(Event::Type type) { m_events->addEvent(Event(type, getEventTarget(), NULL)); } void -CTCPSocket::onConnected() +TCPSocket::onConnected() { m_connected = true; m_readable = true; @@ -378,14 +378,14 @@ CTCPSocket::onConnected() } void -CTCPSocket::onInputShutdown() +TCPSocket::onInputShutdown() { m_inputBuffer.pop(m_inputBuffer.getSize()); m_readable = false; } void -CTCPSocket::onOutputShutdown() +TCPSocket::onOutputShutdown() { m_outputBuffer.pop(m_outputBuffer.getSize()); m_writable = false; @@ -396,7 +396,7 @@ CTCPSocket::onOutputShutdown() } void -CTCPSocket::onDisconnected() +TCPSocket::onDisconnected() { // disconnected onInputShutdown(); @@ -405,7 +405,7 @@ CTCPSocket::onDisconnected() } ISocketMultiplexerJob* -CTCPSocket::serviceConnecting(ISocketMultiplexerJob* job, +TCPSocket::serviceConnecting(ISocketMultiplexerJob* job, bool, bool write, bool error) { Lock lock(&m_mutex); @@ -449,7 +449,7 @@ CTCPSocket::serviceConnecting(ISocketMultiplexerJob* job, } ISocketMultiplexerJob* -CTCPSocket::serviceConnected(ISocketMultiplexerJob* job, +TCPSocket::serviceConnected(ISocketMultiplexerJob* job, bool read, bool write, bool error) { Lock lock(&m_mutex); diff --git a/src/lib/net/TCPSocket.h b/src/lib/net/TCPSocket.h index 0983a360..a07cdc3f 100644 --- a/src/lib/net/TCPSocket.h +++ b/src/lib/net/TCPSocket.h @@ -34,11 +34,11 @@ class SocketMultiplexer; /*! A data socket using TCP. */ -class CTCPSocket : public IDataSocket { +class TCPSocket : public IDataSocket { public: - CTCPSocket(IEventQueue* events, SocketMultiplexer* socketMultiplexer); - CTCPSocket(IEventQueue* events, SocketMultiplexer* socketMultiplexer, ArchSocket socket); - ~CTCPSocket(); + TCPSocket(IEventQueue* events, SocketMultiplexer* socketMultiplexer); + TCPSocket(IEventQueue* events, SocketMultiplexer* socketMultiplexer, ArchSocket socket); + ~TCPSocket(); // ISocket overrides virtual void bind(const NetworkAddress&); diff --git a/src/lib/net/TCPSocketFactory.cpp b/src/lib/net/TCPSocketFactory.cpp index c7755957..74bd467c 100644 --- a/src/lib/net/TCPSocketFactory.cpp +++ b/src/lib/net/TCPSocketFactory.cpp @@ -22,29 +22,29 @@ #include "net/TCPListenSocket.h" // -// CTCPSocketFactory +// TCPSocketFactory // -CTCPSocketFactory::CTCPSocketFactory(IEventQueue* events, SocketMultiplexer* socketMultiplexer) : +TCPSocketFactory::TCPSocketFactory(IEventQueue* events, SocketMultiplexer* socketMultiplexer) : m_events(events), m_socketMultiplexer(socketMultiplexer) { // do nothing } -CTCPSocketFactory::~CTCPSocketFactory() +TCPSocketFactory::~TCPSocketFactory() { // do nothing } IDataSocket* -CTCPSocketFactory::create() const +TCPSocketFactory::create() const { - return new CTCPSocket(m_events, m_socketMultiplexer); + return new TCPSocket(m_events, m_socketMultiplexer); } IListenSocket* -CTCPSocketFactory::createListen() const +TCPSocketFactory::createListen() const { return new TCPListenSocket(m_events, m_socketMultiplexer); } diff --git a/src/lib/net/TCPSocketFactory.h b/src/lib/net/TCPSocketFactory.h index f74ee6dc..7a8cccfd 100644 --- a/src/lib/net/TCPSocketFactory.h +++ b/src/lib/net/TCPSocketFactory.h @@ -24,10 +24,10 @@ class IEventQueue; class SocketMultiplexer; //! Socket factory for TCP sockets -class CTCPSocketFactory : public ISocketFactory { +class TCPSocketFactory : public ISocketFactory { public: - CTCPSocketFactory(IEventQueue* events, SocketMultiplexer* socketMultiplexer); - virtual ~CTCPSocketFactory(); + TCPSocketFactory(IEventQueue* events, SocketMultiplexer* socketMultiplexer); + virtual ~TCPSocketFactory(); // ISocketFactory overrides virtual IDataSocket* create() const; diff --git a/src/lib/synergy/ClientApp.cpp b/src/lib/synergy/ClientApp.cpp index 24d100ce..0d684efa 100644 --- a/src/lib/synergy/ClientApp.cpp +++ b/src/lib/synergy/ClientApp.cpp @@ -340,7 +340,7 @@ ClientApp::openClient(const String& name, const NetworkAddress& address, m_events, name, address, - new CTCPSocketFactory(m_events, getSocketMultiplexer()), + new TCPSocketFactory(m_events, getSocketMultiplexer()), NULL, screen, crypto, diff --git a/src/lib/synergy/ServerApp.cpp b/src/lib/synergy/ServerApp.cpp index 9c4d29c7..1d6e4443 100644 --- a/src/lib/synergy/ServerApp.cpp +++ b/src/lib/synergy/ServerApp.cpp @@ -631,7 +631,7 @@ ServerApp::openClientListener(const NetworkAddress& address) { ClientListener* listen = new ClientListener( address, - new CTCPSocketFactory(m_events, getSocketMultiplexer()), + new TCPSocketFactory(m_events, getSocketMultiplexer()), NULL, args().m_crypto, m_events); diff --git a/src/test/integtests/net/NetworkTests.cpp b/src/test/integtests/net/NetworkTests.cpp index 8ff59ef7..38d4d00c 100644 --- a/src/test/integtests/net/NetworkTests.cpp +++ b/src/test/integtests/net/NetworkTests.cpp @@ -115,7 +115,7 @@ TEST_F(NetworkTests, sendToClient_mockData) // server SocketMultiplexer serverSocketMultiplexer; - CTCPSocketFactory* serverSocketFactory = new CTCPSocketFactory(&m_events, &serverSocketMultiplexer); + TCPSocketFactory* serverSocketFactory = new TCPSocketFactory(&m_events, &serverSocketMultiplexer); ClientListener listener(serverAddress, serverSocketFactory, NULL, cryptoOptions, &m_events); NiceMock serverScreen; NiceMock primaryClient; @@ -137,7 +137,7 @@ TEST_F(NetworkTests, sendToClient_mockData) // client NiceMock clientScreen; SocketMultiplexer clientSocketMultiplexer; - CTCPSocketFactory* clientSocketFactory = new CTCPSocketFactory(&m_events, &clientSocketMultiplexer); + TCPSocketFactory* clientSocketFactory = new TCPSocketFactory(&m_events, &clientSocketMultiplexer); ON_CALL(clientScreen, getShape(_, _, _, _)).WillByDefault(Invoke(getScreenShape)); ON_CALL(clientScreen, getCursorPos(_, _)).WillByDefault(Invoke(getCursorPos)); @@ -168,7 +168,7 @@ TEST_F(NetworkTests, sendToClient_mockFile) // server SocketMultiplexer serverSocketMultiplexer; - CTCPSocketFactory* serverSocketFactory = new CTCPSocketFactory(&m_events, &serverSocketMultiplexer); + TCPSocketFactory* serverSocketFactory = new TCPSocketFactory(&m_events, &serverSocketMultiplexer); ClientListener listener(serverAddress, serverSocketFactory, NULL, cryptoOptions, &m_events); NiceMock serverScreen; NiceMock primaryClient; @@ -190,7 +190,7 @@ TEST_F(NetworkTests, sendToClient_mockFile) // client NiceMock clientScreen; SocketMultiplexer clientSocketMultiplexer; - CTCPSocketFactory* clientSocketFactory = new CTCPSocketFactory(&m_events, &clientSocketMultiplexer); + TCPSocketFactory* clientSocketFactory = new TCPSocketFactory(&m_events, &clientSocketMultiplexer); ON_CALL(clientScreen, getShape(_, _, _, _)).WillByDefault(Invoke(getScreenShape)); ON_CALL(clientScreen, getCursorPos(_, _)).WillByDefault(Invoke(getCursorPos)); @@ -221,7 +221,7 @@ TEST_F(NetworkTests, sendToServer_mockData) // server SocketMultiplexer serverSocketMultiplexer; - CTCPSocketFactory* serverSocketFactory = new CTCPSocketFactory(&m_events, &serverSocketMultiplexer); + TCPSocketFactory* serverSocketFactory = new TCPSocketFactory(&m_events, &serverSocketMultiplexer); ClientListener listener(serverAddress, serverSocketFactory, NULL, cryptoOptions, &m_events); NiceMock serverScreen; NiceMock primaryClient; @@ -238,7 +238,7 @@ TEST_F(NetworkTests, sendToServer_mockData) // client NiceMock clientScreen; SocketMultiplexer clientSocketMultiplexer; - CTCPSocketFactory* clientSocketFactory = new CTCPSocketFactory(&m_events, &clientSocketMultiplexer); + TCPSocketFactory* clientSocketFactory = new TCPSocketFactory(&m_events, &clientSocketMultiplexer); ON_CALL(clientScreen, getShape(_, _, _, _)).WillByDefault(Invoke(getScreenShape)); ON_CALL(clientScreen, getCursorPos(_, _)).WillByDefault(Invoke(getCursorPos)); @@ -274,7 +274,7 @@ TEST_F(NetworkTests, sendToServer_mockFile) // server SocketMultiplexer serverSocketMultiplexer; - CTCPSocketFactory* serverSocketFactory = new CTCPSocketFactory(&m_events, &serverSocketMultiplexer); + TCPSocketFactory* serverSocketFactory = new TCPSocketFactory(&m_events, &serverSocketMultiplexer); ClientListener listener(serverAddress, serverSocketFactory, NULL, cryptoOptions, &m_events); NiceMock serverScreen; NiceMock primaryClient; @@ -291,7 +291,7 @@ TEST_F(NetworkTests, sendToServer_mockFile) // client NiceMock clientScreen; SocketMultiplexer clientSocketMultiplexer; - CTCPSocketFactory* clientSocketFactory = new CTCPSocketFactory(&m_events, &clientSocketMultiplexer); + TCPSocketFactory* clientSocketFactory = new TCPSocketFactory(&m_events, &clientSocketMultiplexer); ON_CALL(clientScreen, getShape(_, _, _, _)).WillByDefault(Invoke(getScreenShape)); ON_CALL(clientScreen, getCursorPos(_, _)).WillByDefault(Invoke(getCursorPos));