Hello All,
When I try to create a TCPStream with a wrong InetHostAddrres it doesn't come back from the creation of tcp stream.
I trace it, and I found void TCPStream::Connect(const InetHostAddress &host, tpport_t port, int size) { size_t i; for(i = 0 ; i < host.getAddressCount(); i++) { struct sockaddr_in addr; memset(&addr, 0, sizeof(addr)); addr.sin_family = AF_INET; addr.sin_addr = host.getAddress(i); addr.sin_port = htons(port); if(connect(so, (struct sockaddr *)&addr, (socklen_t)sizeof(addr)) == 0) break; }
if(i == host.getAddressCount()) { connectError(); endSocket(); return; }
Allocate(size); Socket::state = SOCKET_CONNECTED; }
host.getAddressCount() egal to 354000000 , so it executes for ever pretty much.
this is a bug or some set up is needed.
thank you for this help
marco
I think this is a bug...
Log in to post a comment.
Hello All,
When I try to create a TCPStream with a wrong InetHostAddrres it doesn't come back from the creation of tcp stream.
I trace it, and I found
void TCPStream::Connect(const InetHostAddress &host, tpport_t port, int size)
{
size_t i;
for(i = 0 ; i < host.getAddressCount(); i++)
{
struct sockaddr_in addr;
memset(&addr, 0, sizeof(addr));
addr.sin_family = AF_INET;
addr.sin_addr = host.getAddress(i);
addr.sin_port = htons(port);
if(connect(so, (struct sockaddr *)&addr, (socklen_t)sizeof(addr)) == 0)
break;
}
if(i == host.getAddressCount())
{
connectError();
endSocket();
return;
}
Allocate(size);
Socket::state = SOCKET_CONNECTED;
}
host.getAddressCount() egal to 354000000 , so it executes for ever pretty much.
this is a bug or some set up is needed.
thank you for this help
marco
I think this is a bug...