TForm1 = class(tform)
procedure onConnectionError(Sender:TObject;Socket:TCustomWinSocket;
ErrorEvent:TErrorEvent;var errorCode:integer);
//定义在这里,使之成为TNotifyEvent
...
public
private
end;
procedure TForm1.ServerSocket1Accept(Sender: TObject;
Socket: TCustomWinSocket);
var
i:integer;
begin
socket.onErrorEvent := onConnectionError;
...
end;
procedure TForm1.onConnectionError(Sender:TObject;Socket:TCustomWinSocket;
ErrorEvent:TErrorEvent;var errorCode:integer);
begin
//Error Handling
end;