# Class Connection

#### Hierarchy (View Summary)

- Emitter
  - Connection

- Defined in packages/net/src/Connection.ts:19

#####
Index

### Constructors

constructor

### Properties

auth
sender
socket
state
stats
status
url
defaultMaxListeners

### Methods

addListener
close
emit
eventNames
getMaxListeners
listenerCount
listeners
off
on
once
prependListener
prependOnceListener
rawListeners
removeAllListeners
removeListener
send
setMaxListeners
listenerCount

##
Constructors

### constructor

- new Connection(url: string): Connection

- #### Parameters

  - url: string

  #### Returns Connection

  Overrides Emitter.constructor

  - Defined in packages/net/src/Connection.ts:28

##
Properties

### auth

auth: ConnectionAuth

- Defined in packages/net/src/Connection.ts:25

### sender

sender: ConnectionSender

- Defined in packages/net/src/Connection.ts:22

### socket

socket: Socket

- Defined in packages/net/src/Connection.ts:21

### state

state: ConnectionState

- Defined in packages/net/src/Connection.ts:23

### stats

stats: ConnectionStats

- Defined in packages/net/src/Connection.ts:24

### status

status: ConnectionStatus = Ready

- Defined in packages/net/src/Connection.ts:26

### url

url: string

- Defined in packages/net/src/Connection.ts:20

### `Static` defaultMaxListeners

defaultMaxListeners: number

Inherited from Emitter.defaultMaxListeners

- Defined in node_modules/@types/events/index.d.ts:5

##
Methods

### addListener

- addListener(type: string | number, listener: Listener): this

- #### Parameters

  - type: string | number
  - listener: Listener

  #### Returns this

  Inherited from Emitter.addListener

  - Defined in node_modules/@types/events/index.d.ts:11

### close

- close(): Promise<void>

- #### Returns Promise<void>

  - Defined in packages/net/src/Connection.ts:54

### emit

- emit(type: ConnectionEvent , ...args: any[]): boolean

- #### Parameters

  - type: ConnectionEvent
  - ...args: any[]

  #### Returns boolean

  Overrides Emitter.emit

  - Defined in packages/net/src/Connection.ts:44

### eventNames

- eventNames(): (string | number)[]

- #### Returns (string | number)[]

  Inherited from Emitter.eventNames

  - Defined in node_modules/@types/events/index.d.ts:7

### getMaxListeners

- getMaxListeners(): number

- #### Returns number

  Inherited from Emitter.getMaxListeners

  - Defined in node_modules/@types/events/index.d.ts:9

### listenerCount

- listenerCount(type: string | number): number

- #### Parameters

  - type: string | number

  #### Returns number

  Inherited from Emitter.listenerCount

  - Defined in node_modules/@types/events/index.d.ts:20

### listeners

- listeners(type: string | number): Listener[]

- #### Parameters

  - type: string | number

  #### Returns Listener[]

  Inherited from Emitter.listeners

  - Defined in node_modules/@types/events/index.d.ts:19

### off

- off(type: string | number, listener: Listener): this

- #### Parameters

  - type: string | number
  - listener: Listener

  #### Returns this

  Inherited from Emitter.off

  - Defined in node_modules/@types/events/index.d.ts:17

### on

- on(type: string | number, listener: Listener): this

- #### Parameters

  - type: string | number
  - listener: Listener

  #### Returns this

  Inherited from Emitter.on

  - Defined in node_modules/@types/events/index.d.ts:12

### once

- once(type: string | number, listener: Listener): this

- #### Parameters

  - type: string | number
  - listener: Listener

  #### Returns this

  Inherited from Emitter.once

  - Defined in node_modules/@types/events/index.d.ts:13

### prependListener

- prependListener(type: string | number, listener: Listener): this

- #### Parameters

  - type: string | number
  - listener: Listener

  #### Returns this

  Inherited from Emitter.prependListener

  - Defined in node_modules/@types/events/index.d.ts:14

### prependOnceListener

- prependOnceListener(type: string | number, listener: Listener): this

- #### Parameters

  - type: string | number
  - listener: Listener

  #### Returns this

  Inherited from Emitter.prependOnceListener

  - Defined in node_modules/@types/events/index.d.ts:15

### rawListeners

- rawListeners(type: string | number): Listener[]

- #### Parameters

  - type: string | number

  #### Returns Listener[]

  Inherited from Emitter.rawListeners

  - Defined in node_modules/@types/events/index.d.ts:21

### removeAllListeners

- removeAllListeners(type?: string | number): this

- #### Parameters

  - `Optional` type: string | number

  #### Returns this

  Inherited from Emitter.removeAllListeners

  - Defined in node_modules/@types/events/index.d.ts:18

### removeListener

- removeListener(type: string | number, listener: Listener): this

- #### Parameters

  - type: string | number
  - listener: Listener

  #### Returns this

  Inherited from Emitter.removeListener

  - Defined in node_modules/@types/events/index.d.ts:16

### send

- send(message: Message ): Promise<void>

- #### Parameters

  - message: Message

  #### Returns Promise<void>

  - Defined in packages/net/src/Connection.ts:46

### setMaxListeners

- setMaxListeners(n: number): this

- #### Parameters

  - n: number

  #### Returns this

  Inherited from Emitter.setMaxListeners

  - Defined in node_modules/@types/events/index.d.ts:8

### `Static` listenerCount

- listenerCount(emitter: EventEmitter, type: string | number): number

- #### Parameters

  - emitter: EventEmitter
  - type: string | number

  #### Returns number

  Inherited from Emitter.listenerCount

  - Defined in node_modules/@types/events/index.d.ts:4