TAsyncSocketManager.addOneshotListener

Adds a listener that is triggered once when an event of the specified type occurs, and removed afterwards.

  1. void addOneshotListener(Socket socket, TAsyncEventType eventType, Duration timeout, TSocketEventListener listener)
    interface TAsyncSocketManager
    void
    addOneshotListener
  2. void addOneshotListener(Socket socket, TAsyncEventType eventType, TSocketEventListener listener)

Parameters

socket Socket

The socket to listen for events at.

eventType TAsyncEventType

The type of the event to listen for.

timeout Duration

The period of time after which the listener will be called with TAsyncEventReason.TIMED_OUT if no event happened.

listener TSocketEventListener

The delegate to call when an event happened.

Meta