Single peer connection that reaches only the leader of the roster

### Hierarchy

- WebSocketConnection
  - LeaderConnection

### Implements

- IConnection

## Index

### Constructors

- constructor

### Methods

- copy
- getURL
- send
- sendStream
- setParallel
- setTimeout

## Constructors

### constructor

- new LeaderConnection(roster: Roster, service: string): LeaderConnection

- Overrides WebSocketConnection.constructor

  - Defined in src/network/websocket.ts:233

  #### Parameters

  - ##### roster: Roster

    The roster to use

  - ##### service: string

    The name of the service

  #### Returns LeaderConnection

## Methods

### copy

- copy(service: string): IConnection

- Implementation of IConnection.copy

  Inherited from WebSocketConnection.copy

  - Defined in src/network/websocket.ts:90

  #### Parameters

  - ##### service: string

  #### Returns IConnection

### getURL

- getURL(): string

- Implementation of IConnection.getURL

  Inherited from WebSocketConnection.getURL

  - Defined in src/network/websocket.ts:65

  Get the origin of the distant address

  #### Returns string

  the address as a string

### send

- send<T>(message: Message, reply: Message): Promise<T>

- Implementation of IConnection.send

  Inherited from WebSocketConnection.send

  - Defined in src/network/websocket.ts:77

  Send a message to the distant peer

  #### Type parameters

  - #### T: Message

  #### Parameters

  - ##### message: Message

  - ##### reply: Message

  #### Returns Promise<T>

  a promise resolving with the reply on success, rejecting otherwise

### sendStream

- sendStream<T>(message: Message, reply: Message): Observable<[T, WebSocketAdapter]>

- Implementation of IConnection.sendStream

  Inherited from WebSocketConnection.sendStream

  - Defined in src/network/websocket.ts:105

  Send a message to the distant peer

  #### Type parameters

  - #### T: Message

  #### Parameters

  - ##### message: Message

  - ##### reply: Message

  #### Returns Observable<[T, WebSocketAdapter]>

### setParallel

- setParallel(p: number): void

- Implementation of IConnection.setParallel

  Inherited from WebSocketConnection.setParallel

  - Defined in src/network/websocket.ts:98
  deprecated
    - use directly a RosterWSConnection if you want that

  #### Parameters

  - ##### p: number

  #### Returns void

### setTimeout

- setTimeout(value: number): void

- Implementation of IConnection.setTimeout

  Inherited from WebSocketConnection.setTimeout

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

  Set the timeout value for new connections

  #### Parameters

  - ##### value: number

  #### Returns void

Generated using TypeDoc