Menu

BLOCKING ON TCPSTREAM

Help
Anonymous
2001-04-30
2001-05-01
  • Anonymous

    Anonymous - 2001-04-30

    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

     
    • David Sugar

      David Sugar - 2001-05-01

      I think this is a bug...

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.