× 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.



Hi Craig,

The default timeout on connect() is between two and three minutes. The way
to control this is to set the socket to non-blocking, do the connect(),
check to see if the connection actually happened (it might have been
successful, but probably not), then use select() with a timeout value. The
select function lets you set the timeout to any value you want and you can
control how long you want to wait for that connection.

You might also have better luck detecting the network error if you activate
the TCP keep-alive function. But I've found this a bit iffy. I haven't
worked with the LANtronics device for years, so I don't know if it supports
keep-alive.

Patrick

---------------------------------------------
Patrick Townsend
President
Patrick Townsend Security Solutions
    the encryption company
Direct: 800 357-1019 Ext 106
Fax:  360 357-9047
patrick.townsend@xxxxxxxxxxxxxx

================================
Encrypt 10 Million credit cards in under 7 seconds!  
www.patownsend.com



-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of Craig Jacobsen
Sent: Friday, October 24, 2008 12:01 PM
To: 'RPG programming on the AS400 / iSeries'
Subject: Test device before connect()

I am using Scott Klement's socket programs to get weights from scales.
This has been running fine for over a year (thanks Scott).

Ever since the network replaced its wireless controller early this week, the
wireless connection drops at times.
(I'm already in touch with Lantronix)

When it drops, the connect() hangs for 3 to 5 minutes trying to make a
connection.
(I would like that to be a few seconds, but there are no time out values
that I can see.)
This hangs the 5250 manifest station for minutes before I can issue an error
message.

I have temporarily put a Ping in to the device before I create a socket to
the IP and port and try the connect().
Is there a way to shorten the time outs during the connect()?
The problem with the ping is it sometimes activates right after the ping.
I'm thinking if the connect() was 5 - 10 seconds, I could get good weights
most of the time.
I'm also thinking the Cisco controller is not configured properly, but
getting the network people to verify this is a nightmare.

Thanks,

Craig




As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.