This adapter basically binds the browser websocket interface. Note that the websocket will try to open right after instantiation.

### Hierarchy

- WebSocketAdapter
  - BrowserWebSocketAdapter

## Index

### Constructors

- constructor

### Properties

- path
- ws

### Methods

- close
- onClose
- onError
- onMessage
- onOpen
- send

## Constructors

### constructor

- new BrowserWebSocketAdapter(path: string): BrowserWebSocketAdapter

- Overrides WebSocketAdapter.constructor

  - Defined in src/network/websocket-adapter.ts:57

  #### Parameters

  - ##### path: string

  #### Returns BrowserWebSocketAdapter

## Properties

### path

path: string

Inherited from WebSocketAdapter.path

- Defined in src/network/websocket-adapter.ts:9

### Private ws

ws: WebSocket

- Defined in src/network/websocket-adapter.ts:57

## Methods

### close

- close(code: number, reason?: string): void

- Overrides WebSocketAdapter.close

  - Defined in src/network/websocket-adapter.ts:104
  inheritdoc

  #### Parameters

  - ##### code: number

  - ##### Default value reason: string = ""

  #### Returns void

### onClose

- onClose(callback: function): void

- Overrides WebSocketAdapter.onClose

  - Defined in src/network/websocket-adapter.ts:85
  inheritdoc

  #### Parameters

  - ##### callback: function

    - - (code: number, reason: string): void

      - #### Parameters

        - ##### code: number

        - ##### reason: string

        #### Returns void

### onError

- onError(callback: function): void

- Overrides WebSocketAdapter.onError

  - Defined in src/network/websocket-adapter.ts:92
  inheritdoc

  #### Parameters

  - ##### callback: function

    - - (err: Error): void

      - #### Parameters

        - ##### err: Error

        #### Returns void

### onMessage

- onMessage(callback: function): void

- Overrides WebSocketAdapter.onMessage

  - Defined in src/network/websocket-adapter.ts:72
  inheritdoc

  #### Parameters

  - ##### callback: function

    - - (data: Buffer): void

      - #### Parameters

        - ##### data: Buffer

        #### Returns void

### onOpen

- onOpen(callback: function): void

- Overrides WebSocketAdapter.onOpen

  - Defined in src/network/websocket-adapter.ts:67
  inheritdoc

  #### Parameters

  - ##### callback: function

    - - (): void

      - #### Returns void

### send

- send(bytes: Buffer): void

- Overrides WebSocketAdapter.send

  - Defined in src/network/websocket-adapter.ts:99
  inheritdoc

  #### Parameters

  - ##### bytes: Buffer

  #### Returns void

Generated using TypeDoc