Hello, the protocol used is TCP, the POS terminal sends to the server is a
string of ASCII characters like this
"ACTION=VENDA&ID_TERMINAL=528-533-378&ID_EVENTO=00001579&ID_SETOR=00018087&QTDE=01&TPEMISSAO=0&TIPO=0&MAG=0"
what
happens is that after some transactions by sending the string to the
server, the event OnDataAvailable is no longer triggered, the connection is
opened the data sent from the POS terminal to the server and the event is
not fired, I do not know why what reason, this happens only with the
component TWSocketServer, since the component TWSocket this problem never
happens whenever the event is triggered OnDataAvailable, doing the same
operation with the two components could be some component configuration
TWSocketServer? I also did the test with TMagIpLog and the same problem
happens after some reports the event to receive the data is no longer
fired, now what I do not understand is that the component TWSocket the
problem does not happen and now with TWSocketServer it happens, and as you
said I should use TWSocketServer not the TWSocket, I am unsure of using it.

thanks again!


2013/5/1 Angus Robertson - Magenta Systems Ltd <an...@magsys.co.uk>

> > Could use ThrdServer example, the problem was solved with
> > "WSocketServer1.Banner: ='';" now I can not receive data, by
> > setting longer just LINEMODE = FALSE, and after a few connections,
> > does not enter the event "OnDataAvailable" when LINEMODE = TRUE event
> > "OnDataAvailable" is never triggered
>
> OnDataAvailable is identical in all ICS components, does not matter which
> client or server demos you look at.
>
> You have not told us what protocol your POS terminals are using,
> specifically whether it is ASCII line oriented or binary packets, and
> LINEMODE=TRUE will only work with the former.
>
> In practice, I rarely use LINEMODE=true even for line oriented protocols,
> because sometimes those lines may be thousands of characters long and
> exceed the buffers.  I usually use Receive or ReceiveFrom to accept data
> into a buffer, and then loop through the buffer character by character
> checking for line endings and other control characters and writing a
> simple string for further processing.  The loop can check for long lines
> and have a timeout if data stops half way through a line.
>
> For an example look at procedure TMagIpLog.SocketDataAvailable in the
> component I recommended you use for testing yesterday, you are simply
> trying to reinvent stuff that others have done already.
>
> Angus
>
> --
> To unsubscribe or change your settings for TWSocket mailing list
> please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
> Visit our website at http://www.overbyte.be
>
--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to