Exemplo n.º 1
0
void Server::connect(SocksClientSocket &me, const IPSockAddress &peer)
{
    open(me, me);
    Message request(socksConnect, peer.address(), peer.port());
    request.send(me);
    Message reply(me);
    me.mLocalAddress = reply.address();
    me.mPeerAddress = peer;
    secdebug("socks", "%d socks connected to %s", me.fd(), string(peer).c_str());
}
//
// Message properties
//
Message::Message(Command cmd, const IPSockAddress &address)
    : version(4), message(cmd), port(htons(address.port())), addr(address.address())
{
}
Exemplo n.º 3
0
IPSockAddress IPSockAddress::defaults(const IPSockAddress &defaultAddr) const
{
    return defaults(defaultAddr.address(), defaultAddr.port());
}