Results 1 to 2 of 2

Thread: handle leak ?句柄泄漏?

  1. #1
    run.mei is offline Registered User
    Join Date
    Jul 2005
    Posts
    1

    handle leak ?句柄泄漏?

    在下面的函数中

    SOCKET
    IceInternal::createSocket(bool udp)
    {
    SOCKET fd;

    if(udp)
    {
    fd = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP);
    }
    else
    {
    fd = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);
    }

    if(fd == INVALID_SOCKET)
    {
    SocketException ex(__FILE__, __LINE__);
    ex.error = getSocketErrno();
    throw ex;
    }

    #if defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0400)
    //
    // Temporary work-around!
    // Make this socket non-inheritable, so that IcePack-launched servers
    // do not inherit it.
    //
    if(!SetHandleInformation(reinterpret_cast<HANDLE>( fd), HANDLE_FLAG_INHERIT, 0))
    {



    ////////////////////////////////////////////
    handle leak?

    SyscallException ex(__FILE__, __LINE__);
    ex.error = getSystemErrno();
    throw ex;
    }
    #endif

    if(!udp)
    {
    setTcpNoDelay(fd);
    setKeepAlive(fd);
    }

    return fd;
    }

  2. #2
    benoit's Avatar
    benoit is offline ZeroC Staff
    Name: Benoit Foucher
    Organization: ZeroC, Inc.
    Project: Ice
    Join Date
    Feb 2003
    Location
    Rennes, France
    Posts
    2,196
    Thanks for the bug report! We should indeed close the socket here before to throw the Ice::SyscallException. This will be fixed in the next release!

    Benoit.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 1
    Last Post: 07-21-2010, 07:32 AM
  2. How to use iceE?
    By yunying in forum Help Center
    Replies: 4
    Last Post: 03-19-2010, 07:00 AM
  3. how to close connection manually in ice?
    By ldr123 in forum Help Center
    Replies: 2
    Last Post: 03-31-2009, 11:59 PM
  4. Replies: 5
    Last Post: 11-05-2007, 11:35 AM
  5. Is ICE compatible with openssl?
    By hero107 in forum Help Center
    Replies: 1
    Last Post: 04-04-2006, 03:44 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •