Whats the difference between:
AContext.Socket.ReadBytes(...);
vs
AContext.IOHandler.ReadBytes(...);
Do they work the same ? Or maybe some cache in IOHandler or something?
The two are actually the exact same method. The Socket
property points to the same IOHandler
component when it is a TIdIOHandlerSocket
-derived object (which is most of the time), and is nil
otherwise. You should use the IOHandler
property directly for most I/O operations, as it offers more flexibility to use Indy with different types of I/O systems. The Socket
property is a useful shortcut for socket-specific functionality, like accessing the socket's associated IP/Port values.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With