std.socket additions #99

Merged
merged 4 commits into from Jun 15, 2011

Conversation

Projects
None yet
3 participants
@klickverbot
Member

klickverbot commented Jun 12, 2011

Not a std.socket rewrite, sorry – this merely exposes the socket options for setting the recv()/send() timeout, and adds a way to get the host name from an InternetAddress. Requires druntime pull request 28.

klickverbot added some commits Jun 3, 2011

Added send/receive timeout socket options.
The strange timeout behavior on Windows (effective timeout = value + ~500ms) has been confirmed on Windows 7, Windows Server 2008 R2 and Windows XP.
Added InternetAddress.toHostNameString() for looking up the host name.
I am not particularly fond of the method name, but it follows the existing scheme.
@klickverbot

This comment has been minimized.

Show comment
Hide comment
@klickverbot

klickverbot Jun 15, 2011

Member

@andralex: I updated the pull request to address your comments and added a workaround for pre-XP systems. I'd appreciate if you could look into it soon, as my Thrift work depends on it.

Member

klickverbot commented Jun 15, 2011

@andralex: I updated the pull request to address your comments and added a workaround for pre-XP systems. I'd appreciate if you could look into it soon, as my Thrift work depends on it.

@klickverbot

This comment has been minimized.

Show comment
Hide comment
@klickverbot

klickverbot Jun 15, 2011

Member

Oh, and as your comments got lost because I overwrote the commits: getOption() doesn't simply return a Duration because it is an overload to three other, already existing methods – I figured it would make sense to stick with the existing API for now, even if it has its issues.

Member

klickverbot commented Jun 15, 2011

Oh, and as your comments got lost because I overwrote the commits: getOption() doesn't simply return a Duration because it is an overload to three other, already existing methods – I figured it would make sense to stick with the existing API for now, even if it has its issues.

andralex added a commit that referenced this pull request Jun 15, 2011

@andralex andralex merged commit b4a5f33 into dlang:master Jun 15, 2011

@CyberShadow

This comment has been minimized.

Show comment
Hide comment
@CyberShadow

CyberShadow Sep 5, 2011

Member

in network byte order

No, it's not... the function starts with an htonl call. The call at line 869 never worked (see 7aa9e5f for test and fix).

Member

CyberShadow commented on std/socket.d in 955b112 Sep 5, 2011

in network byte order

No, it's not... the function starts with an htonl call. The call at line 869 never worked (see 7aa9e5f for test and fix).

This comment has been minimized.

Show comment
Hide comment
@klickverbot

klickverbot Sep 5, 2011

Member

That's what you get for first directly using gethostbyaddr, and not running your tests on Window again after switching to using InternetHost

Member

klickverbot replied Sep 5, 2011

That's what you get for first directly using gethostbyaddr, and not running your tests on Window again after switching to using InternetHost

@CyberShadow

This comment has been minimized.

Show comment
Hide comment
@CyberShadow

CyberShadow Sep 5, 2011

Member

or the IP address in dotted-decimal notation otherwise

Is this supposed to be accurate? The code throws on both gethostbyaddr and getnameinfo failure.

Member

CyberShadow commented on std/socket.d in 955b112 Sep 5, 2011

or the IP address in dotted-decimal notation otherwise

Is this supposed to be accurate? The code throws on both gethostbyaddr and getnameinfo failure.

This comment has been minimized.

Show comment
Hide comment
@klickverbot

klickverbot Sep 5, 2011

Member

This was only an attempt to document the behavior of the gethostbyaddr/getnameinfo behavior, but I agree it could be misleading.

Member

klickverbot replied Sep 5, 2011

This was only an attempt to document the behavior of the gethostbyaddr/getnameinfo behavior, but I agree it could be misleading.

This comment has been minimized.

Show comment
Hide comment
@CyberShadow

CyberShadow Sep 5, 2011

Member

I found documentation for this behavior for getnameinfo, but not gethostbyaddr. Practical tests on Windows show that gethostbyaddr returns WSANO_DATA when a hostname cannot be retrieved.

Member

CyberShadow replied Sep 5, 2011

I found documentation for this behavior for getnameinfo, but not gethostbyaddr. Practical tests on Windows show that gethostbyaddr returns WSANO_DATA when a hostname cannot be retrieved.

kuettler pushed a commit to kuettler/phobos that referenced this pull request Feb 6, 2018

Merge pull request #99 from CyberShadow/rdmd-flock
rdmd: Use a lock file to synchronize concurrent builds in the same workDir
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment