Subject: Re: [libssh2] #163: use libssh2_socket_t for socket type

Re: [libssh2] #163: use libssh2_socket_t for socket type

From: libssh2 Trac <>
Date: Thu, 04 Mar 2010 01:27:47 -0000

#163: use libssh2_socket_t for socket type
 Reporter: sldr | Owner: bagder
     Type: defect | Status: assigned
 Priority: normal | Milestone:
Component: API | Version: 1.2.4
 Keywords: | Blocking:
Blockedby: |

Comment(by sldr):

 Replying to [comment:4 roadrunn]:
> I may not be doing things correctly, but I cast my socket type to int
 when calling libssh2_session_startup. This works in all (Windows x86/IA64,
 Linux i386/ia64, and HP/UX).

 With a 64bit program if you open enough sockets and/or handles (since a
 socket is a handle on windows), you could get a value that wouldn't fit in
 32bits so cast would cause failure in libssh2 when it was finally passed
 it to a OS API (ie: Win32 API). This doesn't happen very often since most
 programs don't open lots of handles and sockets that might cause the value
 to get large enough that it doesn't fit in 32bits.

 FYI: Ignore the 32 in Win32 because the 64bit APIs are also called Win32
 APIs except when you are running in WOW64 witch means they are 32bit APIs.
 :-) (bad windows joke)

Ticket URL: <>
libssh2 <>
C library for writing portable SSH2 clients
Received on 2010-03-04