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
Merged

Use socket.IPPROTO_TCP for Jython #1375

merged 1 commit into from Nov 22, 2018

Conversation

jfreeland
Copy link
Contributor

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
Copy link
Contributor Author

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
Copy link

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
Copy link
Contributor Author

jfreeland commented Nov 16, 2018

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

@davidism
Copy link
Member

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
Copy link

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
Copy link
Member

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
Copy link
Contributor Author

jfreeland commented Nov 22, 2018 via email

@davidism
Copy link
Member

davidism 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
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants