SocketTools .NET Edition

InternetServer.OnCancel Event

Occurs when a blocking socket operation is canceled.

[Visual Basic]
Public Event OnCancel As OnCancelEventHandler
[C#]
public event OnCancelEventHandler OnCancel;

Event Data

The event handler receives an argument of type InternetServer.CancelEventArgs containing data related to this event. The following InternetServer.CancelEventArgs property provides information specific to this event.

Property Description
Handle Gets a value that specifies the socket handle for the client session.

Remarks

The OnCancel event is generated when a blocking socket operation, such as sending or receiving data, is canceled with the Cancel method.

User interface controls can only be accessed from the UI thread that created them, and attempting to update a control from another thread can result in the program becoming non-responsive or terminating abnormally. Because this event is generated in the context of the client thread, not the thread that created the class instance, you cannot directly modify a control from within this event handler. Instead, you must create a delegate and use the Invoke method to marshal invocations to the associated UI thread. For more information, refer to the documentation for the control.

See Also

InternetServer Class | SocketTools Namespace