× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



On 5/17/13 3:29 PM, Dan Kimmel wrote:
-1 returned from read(byte[], int, int) doesn't mean an EOF character
was read. It means that the sequence of IP packets is done.

As I recall, when the 5250 controller sends a readMDT, it stops
sending and starts waiting for a response. It appears to me that the
behavior is as expected.

I think the error lies in trying to read again after the readMDT is
received.

So long as the socket remains open, the read on it does *not* return an EOF condition; it *blocks* until new bytes appear. Indeed, I have not, within recent memory, succeeded in *forcing* a TN5250 socket connection to EOF-out. Not by varying off the device, not by killing the connection from WRKCFGSTS, and not by physically unplugging the Ethernet cable. And yet for this one installation (and possibly only for certain users), it EOFs out for no apparent reason, and in the case of the most recent capture, it does so less than a second after sending a packet, after working perfectly for dozens, perhaps hundreds, of transmissions in both directions.

If it is as I suspect, the read after receiving readMDT is going to
send an ENQ and the 5250 controller will send back NAK as it is
itself waiting for data. As a matter of fact, the ENQ may be followed
by an ACK, as the receiver is expecting data and says "right, go
ahead and send", but your read never sends anything, so the receiver
would time out and start sending NAK's which may trigger the -1. Hard
to tell as there are so many layers of protocol involved.

That sounds like something specific to Twinax hardware polling. This is TN5250.

--
James H. H. Lampert

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.