Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Socket::Constants incorrect on Windows #1509

Closed
stakach opened this Issue Feb 17, 2014 · 10 comments

Comments

Projects
None yet
4 participants
@stakach
Copy link

stakach commented Feb 17, 2014

irb(main):001:0> require 'socket'
=> true
irb(main):002:0> Socket::Constants::AF_INET
=> 4
irb(main):003:0> Socket::Constants::AF_INET6
=> 33
irb(main):004:0> RUBY_DESCRIPTION
=> "jruby 1.7.10 (1.9.3p392) 2014-01-09 c4ecd6b on Java HotSpot(TM) Client VM 1.7.0_07-b10 [Windows 7-x86]"
irb(main):005:0>

According to MSDN values should be

  • Socket::Constants::AF_INET == 2
  • Socket::Constants::AF_INET6 == 23

stakach pushed a commit to cotag/libuv that referenced this issue Feb 17, 2014

Stephen von Takach
fix DNS on windows
jRuby was not returning the correct socket hint values see
jruby/jruby#1509
Clean up TLS memory in TCP
Adjust some specs so they pass on windows
bump version

@enebo enebo added the windows label Feb 17, 2017

@ahorek

This comment has been minimized.

Copy link
Contributor

ahorek commented Sep 6, 2018

@enebo

This comment has been minimized.

Copy link
Member

enebo commented Sep 6, 2018

@ahorek I merged that I and I guess we will need to run a script to populate for next jnr-constant release but I see we hard-coded numbers in that commit above. Maybe we can get more updated for AF_INET and AF_INET6 are generated? Or is that not in jnr-constant?

@ahorek

This comment has been minimized.

Copy link
Contributor

ahorek commented Sep 6, 2018

@enebo thanks
it would be great if you could review jnr-constants pull requests
especially these two should be ready
jnr/jnr-constants#30
jnr/jnr-constants#28

after that we have to run the generation script for all platforms and commit generated files separately. Sounds good?

@ahorek

This comment has been minimized.

Copy link
Contributor

ahorek commented Sep 6, 2018

cotag/libuv@22e0ed6 no, this one isn't in jnr-constant repository. It was a workaround for https://github.com/cotag/libuv

jnr/jnr-constants#31 will fix it properly

@headius

This comment has been minimized.

Copy link
Member

headius commented Sep 8, 2018

I've merged all mentioned PRs for jnr-constants. There's no changes when regenerating for MacOS.

@headius headius added this to the JRuby 9.2.1.0 milestone Sep 8, 2018

@ahorek

This comment has been minimized.

Copy link
Contributor

ahorek commented Sep 8, 2018

there should be changes for all supported platforms including macos.

I ran these commands on linux and windows

rake regen:xplatform
rake regen:platform
rake regen:fake

but something went wrong, do you have a tip how to fix these failures?

Lack of description for EAUTH expected not same
Incorrect integer value for EAUTH, expected:<0> but was:<20000>
Incorrect integer value for EAUTH, expected:<20000> but was:<20014>

https://github.com/jnr/jnr-constants/pulls/ahorek

@ahorek

This comment has been minimized.

Copy link
Contributor

ahorek commented Sep 9, 2018

@headius it's ready to review. I fixed tests and added constants for freebsd, windows, linux and solaris, but I don't have any macos, aix and openbsd running.

@headius

This comment has been minimized.

Copy link
Member

headius commented Sep 10, 2018

Hmm... I ran those commands too and didn't get anything new. I'll try again.

@headius

This comment has been minimized.

Copy link
Member

headius commented Sep 12, 2018

Closing the loop... jnr/jnr-constants#41 and related PRs were needed to fix a bunch of decay in the generation of jnr-constants. Those are now merged, @ahorek is regenerating for their available platforms, and we should be good to go with a jnr-constants release for 9.2.1.

@headius

This comment has been minimized.

Copy link
Member

headius commented Sep 19, 2018

Looks like some failures in Errno we'll have to look into.

@headius headius closed this in af939f9 Sep 21, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.