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

Use socket.IPPROTO_TCP for Jython #1375

Merged
merged 1 commit into from Nov 22, 2018

Conversation

Projects
None yet
3 participants
@jfreeland
Copy link
Contributor

commented Oct 12, 2018

Minor change to manually specify SOL_TCP = protocol version 6 when starting serving. This attribute does not exist in Jython and requires manual specification.

#1373
pika/pika#67

@jfreeland

This comment has been minimized.

Copy link
Contributor Author

commented Oct 12, 2018

There must be a better way to do what I'm doing. Will revisit soon, have to make progress on other fronts for a bit.

@jandemter

This comment has been minimized.

Copy link

commented Nov 15, 2018

The proper way to solve this is to just use socket.IPPROTO_TCP instead of SOL_TCP. Can you please change your pull request to use that?

@jfreeland

This comment has been minimized.

Copy link
Contributor Author

commented Nov 16, 2018

Sorry for the delay. Will test with IPPROTO_TCP and resubmit next week (holiday).

@davidism

This comment has been minimized.

Copy link
Member

commented Nov 17, 2018

I installed jython, socket.SOL_TCP and socket.IPPROTO_TCP both exist. Tried with OpenJDK 7 and 11, and Oracle JDK 7.

$ /opt/jython/bin/jython 
Jython 2.7.1 (default:0df7adb1b397, Jun 30 2017, 19:02:43) 
[OpenJDK 64-Bit Server VM (Oracle Corporation)] on java11.0.1
Type "help", "copyright", "credits" or "license" for more information.
>>> import socket
>>> socket.IPPROTO_TCP
6
>>> socket.SOL_TCP
6
@jandemter

This comment has been minimized.

Copy link

commented Nov 21, 2018

Does indeed work out of the box with jython 2.7.1, thanks! jython.org offers 2.7.0 as the latest version, that's why I and most likely @jfreeland as well ended up using that.

@davidism

This comment has been minimized.

Copy link
Member

commented Nov 21, 2018

Yeah, I noticed that Arch installed 2.7.1, but their site only lists 2.7.0. I'm OK with changing it to IPPROTO_TCP then.

@davidism davidism added this to the 0.15 milestone Nov 21, 2018

@jfreeland

This comment has been minimized.

Copy link
Contributor Author

commented Nov 22, 2018

@davidism

This comment has been minimized.

Copy link
Member

commented Nov 22, 2018

We already merged a fix for AF_UNIX. I verified that IPPROTO_TCP exists in Jython 2.5.3. Pushed a new patch to the PR with just that change.

@davidism davidism changed the title Issue 1373: socket.SOL_TCP not in Jython, requires manual specification. Use socket.IPPROTO_TCP for Jython Nov 22, 2018

@davidism davidism merged commit 47a5c74 into pallets:master Nov 22, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
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.