Message1838

Author paulj_edgewater
Recipients
Date 2007-08-14.15:44:04
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
I have a script that uses telnetlib to connect to a Linux host, login, run a program and then eventually send control-C to exit the remote program. I wrote this in CPython but when I tried it using Jython I noticed that the telnet connection blocked (in method read_very_eager) shortly after the control-C was issued.

Closer inspection indicated that after the control-C the select() method always reported that data was ready even when the telnet connection had apparently read all the data.

Using Wireshark I determined that the Linux machine responds to the control-C in part by sending an 0xFF byte and an 0xF2 byte. I noticed that the 0xF2 byte was received by the Jython script just before blocking and that the 0xFF byte was not received.

I noticed that the 0xFF byte was sent with the URG flag set.

Sun's Java documentation says that the default behavior is to silently discard urgent data unless setOOBInline(true) is called in which case urgent data is merged into the regular data stream.

I tried setting the OOB inline flag and I got the 0xFF byte in the regular data stream and the problem did not occur.

Perhaps there is a bug in the Java socket implementation in which unreceived urgent data counts as ready data even though it cannot be received?

I'm attaching a script that illustrates the problem.

I did my testing with 2.2RC3
History
Date User Action Args
2008-02-20 17:17:59adminlinkissue1773955 messages
2008-02-20 17:17:59admincreate