Copyright USER1 Subsystems Corporation
2016-3-9 22:01

Class net.user1.orbiter.WebSocketConnection

The WebSocketConnection class is used by Orbiter to communicate with Union Server over a persistent TCP/IP socket. Normally, developers need not use the WebSocketConnection class directly, and should instead make connections via the Orbiter class's connect() method. However, the WebSocketConnection class is required for fine-grained connection configuration, such as defining failover socket connections for multiple Union Servers running at different host addresses.

By default, Orbiter uses WebSocketConnection connections to communicate with Union Server. WebSocketConnection connections offer faster response times than HTTP connections, but occupy an operating-system-level socket continuously for the duration of the connection. If a WebSocketConnection connection cannot be established (due to, say, a restrictive firewall), Orbiter automatically attempts to communicate using HTTP requests sent via an HTTPDirectConnection or HTTPIFrameConnection. Developers can override Orbiter's default connection failover system by manually configuring connections using the ConnectionManager class and Orbiter's disableHTTPFailover() method.

For secure WebSocket and HTTP communications, see SecureWebSocketConnection, SecureHTTPDirectConnection, and SecureHTTPIFrameConnection.

For a list of events dispatched by WebSocketConnection, see WebSocketConnection's superclass, net.user1.orbiter.Connection.

Constructor