예제 #1
0
    Connection(ProactorFile *socket, const HostAddress &addr): 
        mSrcSocket(socket), mDestSocket(nullptr), mRespForwardedPos(0), mCountOfEOF(0) {

        mID = format("Connection(%d,%s)", socket->getFd(), addr.toString().c_str());

        LOG("Connection(%s) established ...", getID());

        mSrcSocket->readLine('\n', [this](bool eof, const char *buf, int n){ onReadRequestline(eof, buf, n); });
    }
예제 #2
0
        void testToString_Invalid() {
            HostAddress testling;

            CPPUNIT_ASSERT_EQUAL(std::string("0.0.0.0"), testling.toString());
        }