|
I have a process that uses sockets to send day to an outside vendor.
Basically this process receives a request via a dtaq. It then
sends/receives the msg to the vendor via a sockets. Then sends the
response to another dtaq to be used by another process. It actually load
balances between two persistent socket connections. I have always
controlled the sending and receiving, including a network message that
functions as a keepalive. Now the vendor want to be able to send
unsolicited network messages to my process. I am not sure how to handle
this. Will I have to use a select() to see if I need to receive a message
before I try to send?
Below is the main logic of the program:
C DoW Shut_Down <> 'Y'
C ShtDn 99
C If *in99 = *On
C Eval Shut_Down = 'Y'
C Leave
C EndIf
C CallP RcvDtaQ('BADQ1' : 'Library' : %LEN(Msg) : Msg : 45)
C If Msg <> *Blanks
C Eval ReturnCode = WrLine(Sock(s) : peLineW : -1 : *off)
C Eval ReturnCode = RdLine(Sock(s): %addr(wMsgLen) : 2 :
*OFF : x'0D' : x'0D')
C Eval ReturnCode = recv(Sock(s) : %Addr(RcvMsg) : wMsgLen :
0)
C CallP SndDtaQ('BADQ2':'Library':%LEN(RcvMsg):RcvMsg:30:Sequence)
C Else
C CallP SndKeepAlive
C EndIf
C EndDo
Thanks,
Mark Garton
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.