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



Sigh.... I should have been a plumber....

Last week I mentioned some 'flaky-ness' with a socket server program. This
is a multi-connection socket server, and I determined that the reason the
connections weren't behaving as expected was because I wasn't using
non-blocking mode. Hence the program appeared to 'hang' while waiting to
receive data.

In my attempt to correct this problem I added code to set the socket to
non-blocked mode. In doing so, I found that after accepting a connection
(which is always 'up'), even though no data is currently being sent (data
will come as it becomes available), I exit my socket read/write loop,
without dropping the socket connection and return to the outer loop which
(I thought) should enable me to check for incoming data on another
connection (ie server shutdown request). But in doing this I found (via
netstat *cnn) that multiple remote ports (from the same remote client) are
connecting to the socket server. This morning there were nine established
connections on different ports all from the same ip address.

As a side note, my listen function is set to one, although I suspect it
should be set to two, so that it can listen to the remote client, and also
listen for a shutdown request from a different source (the local iSeries).
But as it is now, it will shut down while connected to the remote client
and I connect locally to issue the shutdown request with the listen value
set to one.

So this morning I changed the listen value to two, shut down and restarted
and things appeared to be okay for 2.5 hours (only one connection from the
remote client showing in netstat), but when I got back from lunch I now
see two connections on different ports from the same IP address. The
remote should only be establishing one connection should only be sending
on one port.

I'm not sure why this is happening?

Regards, Jerry

Gerald Kern - MIS Project Leader
Lotus Notes/Domino Administrator
IBM Certified RPG IV Developer
The Toledo Clinic, Inc.
4235 Secor Road
Toledo, OH 43623-4299
Phone 419-479-5535
gkern@xxxxxxxxxxxxxxxx


This e-mail message, including any attachments, is for the sole use of the
intended recipient(s) and may contain confidential and privileged
information. Any unauthorized use, disclosure or distribution is
prohibited. If you are not the intended recipient, please inform the
sender by reply e-mail and destroy this and all copies of this message.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.