System.Win.ScktComp.TCustomSocket.OnRead

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property OnRead: TSocketNotifyEvent read FOnRead write FOnRead;

C++

__property TSocketNotifyEvent OnRead = {read=FOnRead, write=FOnRead};

Properties

Type Visibility Source Unit Parent
event protected
System.Win.ScktComp.pas
System.Win.ScktComp.hpp
System.Win.ScktComp TCustomSocket

Description

Occurs when a client socket should read information from the socket connection.

Write an OnRead event handler to read from the socket connection. If the socket is a blocking socket, use a TWinSocketStream object to read from the connection. Otherwise, use the methods of the Socket parameter to perform the actual reading.

Note: Non-blocking sockets do not always receive an OnRead event for the last bit of data passed over the connection. When using a non-blocking socket, check for any unread data in the OnDisconnect event to make sure that everything is handled.

See Also