# Class WsWriteTimeout

java.lang.Object
org.apache.tomcat.websocket.server.WsWriteTimeout

All Implemented Interfaces:
  `BackgroundProcess`

public class WsWriteTimeout extends Object implements BackgroundProcess
Provides timeouts for asynchronous web socket writes. On the server side we only have access to `ServletOutputStream` and `ServletInputStream` so there is no way to set a timeout for writes to the client.

## Constructor Summary

Constructors
Constructor
Description
`WsWriteTimeout()`
Default constructor.

## Method Summary

Modifier and Type
Method
Description
`void`
`backgroundProcess()`
Performs background processing.
`int`
`getProcessPeriod()`
The default value is 1 which means asynchronous write timeouts are processed every 1 second.
`void`
`register(WsRemoteEndpointImplServer endpoint)`
Registers an endpoint for timeout tracking.
`void`
`setProcessPeriod(int period)`
Sets the period, in seconds, between invocations of `BackgroundProcess.backgroundProcess()`.
`void`
`unregister(WsRemoteEndpointImplServer endpoint)`
Unregisters an endpoint from timeout tracking.

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### WsWriteTimeout

public WsWriteTimeout()
Default constructor.

## Method Details

### backgroundProcess

public void backgroundProcess()
Description copied from interface: `BackgroundProcess`
Performs background processing.

Specified by:
  `backgroundProcess` in interface `BackgroundProcess`

### setProcessPeriod

public void setProcessPeriod(int period)
Description copied from interface: `BackgroundProcess`
Sets the period, in seconds, between invocations of `BackgroundProcess.backgroundProcess()`.

Specified by:
  `setProcessPeriod` in interface `BackgroundProcess`
Parameters:
  `period` - the period in seconds

### getProcessPeriod

public int getProcessPeriod()
The default value is 1 which means asynchronous write timeouts are processed every 1 second.

Specified by:
  `getProcessPeriod` in interface `BackgroundProcess`

### register

public void register(WsRemoteEndpointImplServer endpoint)
Registers an endpoint for timeout tracking.

Parameters:
  `endpoint` - the endpoint to register

### unregister

public void unregister(WsRemoteEndpointImplServer endpoint)
Unregisters an endpoint from timeout tracking.

Parameters:
  `endpoint` - the endpoint to unregister