I2PSAM: Don't connect socket in constructor.

This commit is contained in:
Mikal Villa
2014-11-14 19:38:22 +01:00
committed by str4d
parent af34c2b8c5
commit b64ffb7a91
2 changed files with 9 additions and 4 deletions

View File

@ -65,10 +65,6 @@ Socket::Socket(const std::string& SAMHost, uint16_t SAMPort, const std::string&
servAddr_.sin_family = AF_INET;
servAddr_.sin_addr.s_addr = inet_addr(SAMHost.c_str());
servAddr_.sin_port = htons(SAMPort);
init();
if (isOk())
handshake();
}
Socket::Socket(const sockaddr_in& addr, const std::string &minVer, const std::string& maxVer)
@ -107,6 +103,13 @@ Socket::~Socket()
#endif
}
void Socket::bootstrapI2P()
{
init();
if (isOk())
handshake();
}
void Socket::init()
{
socket_ = socket(AF_INET, SOCK_STREAM, 0);

View File

@ -217,6 +217,8 @@ public:
explicit Socket(const Socket& rhs); // creates a new socket with the same parameters
~Socket();
void bootstrapI2P();
void write(const std::string& msg);
std::string read();
SOCKET release();