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



I'm using Scott Klement's socket tutorial as the template for a socket
server that uses non-blocking sockets with select() to support multiple
(3) clients at once.

Right now I have only one client active, but for some reason when I
receive data, I receive the same data string x number of times over a
short period of minutes and in one instance over a period of about 50
minutes.

For example one message was received 23 times (in a row) and the next one
27 times.
Following that the next five unique messages were received 27, 30, 14, 27
& 26 times (each received x number of times in a row).

The client says they are not responsible for sending the same data
repeatedly.

I'm wondering if the following code inserted into this subroutine in the
template to read & write to the buffers is incorrect and responsible for
this problem.

Is this not the correct location (note code prefixed with gpk) to be
reading the input buffers and writing the output buffers?

sk CSR CheckSockets begsr
sk C*------------------------
sk c do MAXCLIENTS C
sk
sk c C occur client
sk
sk c if sock <> -1
sk
sk c if FD_ISSET(sock: readset)
sk c if ReadClient(C) < 0
sk c callp EndClient(C)
sk c callp FD_CLR(sock: excpset)
sk c callp FD_CLR(sock: writeset)
gpk * Load socket data from input buffer, do custom processing,
gpk * and load the ACK to the output buffer...
gpk C Else
gpk C Eval IscketData = *Blanks
gpk C Eval IscketData = rdbuf
gpk C Exsr ReadIscket
gpk C Eval wrbuflen = %Len(OscketData)
gpk C Eval wrbuf = OscketData
sk c endif
sk c endif
sk
sk c if FD_ISSET(sock: writeset)
sk c if WriteClient(C) < 0
sk c callp EndClient(C)
sk c callp FD_CLR(sock: excpset)
sk c callp FD_CLR(sock: writeset)
sk c endif
sk c endif
sk
sk c if FD_ISSET(sock: excpset)
sk c callp EndClient(C)
sk c endif
sk
sk c endif
sk
sk c enddo
sk C*------------------------
sk CSR endsr

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.