[Lazarus] TInetSocket usage - any documentation available?
Mark Morgan Lloyd
markMLl.lazarus at telemetry.co.uk
Wed Oct 21 09:42:53 CEST 2015
Bo Berglund wrote:
> And it looks more complete, there is a chat example which implements a
> bidirectional system using a thread too.
> I will try to stuff this into the existing code if possible...
>
> As Mark Morgan Lloyd has pointed out I *really* need to create an
> encapsulated class for the TCPIP communications so I can use this as
> an alternate component in the existing object and for this I need to
> implement an onReceive event to plug the incoming data into it.
> Otherwise I am in for a really big rewrite of the class.
Although I think that was more in the context of trying to keep
everything together if handling e.g. both serial comms and something
over a socket.
I usually end up with odd requirements that force me to go to low-level
serial port access, or a low-level socket... needing to log times
accurately, a special-purpose telnet server and so on. The result of
this is that I'm often better served with a low-level thread (and
possibly select() calls etc.), with the interface to the main program
being a buffer.
So find some way of encapsulating stuff, but I'd suggest not focussing
on that to the exclusion of getting the main job done.
--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk
[Opinions above are the author's, not those of his employers or colleagues]
More information about the Lazarus
mailing list