Netsimple.
In a single connection is it possible to send multiple packets to the same server?
the next packet is sent after receiving the server response.
If I open one connection per package works well, but with one open NO
source code:
CASE LOC:IPROCESS
OF 1
MyClient.AsyncOpenUse = 1
MyClient.AsyncOpenTimeOut = 1200 !12sec
MyClient.InActiveTimeout = 9000 !90sec
MyClient.SSL = 0
MyClient.Open (CLIP(SIS:SERVER), SIS:PORT)
OF 2 !Espera respuesta del servidor
OF 3 !Establece el id hotel en caso de ser todos
IF LOC:IAll = TRUE
CLEAR(EXCAHOT)
SET(ECH:KEY_NUMERO)
WriteActivity('SET EXCAHOT')
END
LOC:IProcess = 4
OF 4
IF LOC:IAll = TRUE
NEXT(EXCAHOT)
IF NOT ERRORCODE()
LOC:IDHOTEL = ECH:NUMERO
WriteActivity('NEXT:'&LOC:IDHOTEL&' - '&CLIP(ECH:NOMBRE))
LOC:IProcess = 5
ELSE
LOC:IProcess = 99
END
ELSE
LOC:IPROCESS = 5
END
OF 5 !Arma paquete y envia
DO ArmaStringSend
!---Informa sobre los datos que se enviaran
WriteActivity('Enviando:('&LEN(CLIP(StringSend))&')'&CLIP(StringSend))
UpdateEXLOGSIS('Enviando:('&LEN(CLIP(StringSend))&')'&CLIP(StringSend))
MyClient.WholePacketUseLengthField = 1
MyClient.WholePacketSend(StringSend, LEN(CLIP(StringSend)))
LOC:IPROCESS = 6
OF 6 !Espera respuesta del servidor
strwaiting = CLIP(strwaiting)&'.'
WriteActivity(CLIP(strwaiting))
UpdateEXLOGSIS(CLIP(strwaiting))
OF 7 !Salva datos recibidos
DO SaveDataDownloaded
LOC:IPROCESS = 4
UpdateEXLOGSIS('SALVANDO...')
OF 99
MyClient.CLOSE()
WriteActivity('Proceso Terminado')
UpdateEXLOGSIS('Proceso Terminado')
SETCURSOR
LOC:IPROCESS = 0
END