---
url: https://docs.moqtail.dev/ts/api/model/classes/GoAway.md
---
# Class: GoAway

GOAWAY (0x10) winds down a session, or — on a request stream — migrates that one
request.

## Constructors

### Constructor

> **new GoAway**(`newSessionUri?`, `timeout?`): `GoAway`

#### Parameters

##### newSessionUri?

`string`

##### timeout?

`bigint` = `0n`

#### Returns

`GoAway`

## Properties

### newSessionUri?

> `optional` **newSessionUri?**: `string`

***

### timeout

> `readonly` **timeout**: `bigint`

Milliseconds the sender waits for graceful closure; 0 means no specific timeout.
On the control stream the sender closes the session with `GOAWAY_TIMEOUT` after it,
on a request stream it resets the stream with `GOING_AWAY`.

## Methods

### getType()

> **getType**(): [`ControlMessageType`](../enumerations/ControlMessageType.md)

#### Returns

[`ControlMessageType`](../enumerations/ControlMessageType.md)

***

### serialize()

> **serialize**(): [`FrozenByteBuffer`](FrozenByteBuffer.md)

#### Returns

[`FrozenByteBuffer`](FrozenByteBuffer.md)

***

### parsePayload()

> `static` **parsePayload**(`buf`): `GoAway`

#### Parameters

##### buf

[`BaseByteBuffer`](BaseByteBuffer.md)

#### Returns

`GoAway`
