Single peer connection to one single node.

### Hierarchy

- WebSocketConnection
  - LeaderConnection

### Implements

- IConnection

## Index

### Constructors

- constructor

### Properties

- service
- timeout
- url

### Methods

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

## Constructors

### constructor

- new WebSocketConnection(addr: string | URL, service: string): WebSocketConnection

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

  #### Parameters

  - ##### addr: string | URL

    Absolute address of the distant peer

  - ##### service: string

    Name of the service to reach

  #### Returns WebSocketConnection

## Properties

### Private service

service: string

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

### Private timeout

timeout: number

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

### Private url

url: URL

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

## Methods

### copy

- copy(service: string): IConnection

- Implementation of IConnection.copy

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

  #### Parameters

  - ##### service: string

  #### Returns IConnection

### getURL

- getURL(): string

- Implementation of IConnection.getURL

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

  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

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

  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

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

  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

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

  #### Parameters

  - ##### p: number

  #### Returns void

### setTimeout

- setTimeout(value: number): void

- Implementation of IConnection.setTimeout

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

  Set the timeout value for new connections

  #### Parameters

  - ##### value: number

  #### Returns void

Generated using TypeDoc