Skip to content

Use socket.IPPROTO_TCP for Jython - #1375

Merged
davidism merged 1 commit into
pallets:masterfrom
jfreeland:issue-1373
Nov 22, 2018
Merged

Use socket.IPPROTO_TCP for Jython#1375
davidism merged 1 commit into
pallets:masterfrom
jfreeland:issue-1373

Conversation

@jfreeland

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

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

jfreeland commented Nov 16, 2018

Copy link
Copy Markdown
Contributor Author

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

@davidism

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

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

jfreeland commented Nov 22, 2018 via email

Copy link
Copy Markdown
Contributor Author

@davidism

davidism commented Nov 22, 2018

Copy link
Copy Markdown
Member

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.

3 participants