# Interface WebSocketEventSink

public interface WebSocketEventSink
Internal sink used by `WebSocketImpl` subclasses to push lifecycle and message events back into the public `com.codename1.io.WebSocket` facade. Platform implementations call `sink().onXxx(...)` from whichever thread the native layer hands them the event on; the public facade is responsible for routing into the user-registered handlers.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `onBinaryMessage(byte[] message)`
  `void`
  `onClose(int statusCode, String reason)`
  `void`
  `onConnect()`
  `void`
  `onError(Exception ex)`
  `void`
  `onTextMessage(String message)`

- ## Method Details

  - ### onConnect

    void onConnect()

  - ### onTextMessage

    void onTextMessage(String message)

  - ### onBinaryMessage

    void onBinaryMessage(byte[] message)

  - ### onClose

    void onClose(int statusCode, String reason)

  - ### onError

    void onError(Exception ex)