Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SecureHTTPDirectConnection

Hierarchy

Implements

Index

Constructors

constructor

Properties

Readonly target

target: EventDispatcher

Static Readonly DEFAULT_SEND_DELAY

DEFAULT_SEND_DELAY: 300 = 300

The default send-delay used for new HTTPConnection objects. For details, see setSendDelay.

Methods

addEventListener

  • addEventListener(type: string, listener: Function, thisArg: any, priority?: number): boolean
  • Parameters

    • type: string
    • listener: Function
    • thisArg: any
    • Default value priority: number = 0

    Returns boolean

connect

  • connect(): void

disconnect

  • disconnect(): void

dispatchEvent

  • dispatchEvent(event: Event): void
  • Parameters

    • event: Event

    Returns void

dispose

  • dispose(): void

doDispose

  • doDispose(): void

doRequestDeactivation

  • doRequestDeactivation(): void

doRetryHello

  • doRetryHello(): void

doRetryIncoming

  • doRetryIncoming(): void

doRetryOutgoing

  • doRetryOutgoing(): void

doSendHello

  • doSendHello(helloString: string): void

doSendIncoming

  • doSendIncoming(): void

doSendOutgoing

  • doSendOutgoing(data: string): void

getHost

  • getHost(): string | null
  • Returns the host on which the connection will be opened or has been opened.

    Returns string | null

    The host name or ip, as a string.

getListeners

  • getListeners(type: string): EventListener[]
  • Parameters

    • type: string

    Returns EventListener[]

getPort

  • getPort(): number | null
  • Returns the port on which the connection will be opened or has been opened.

    Returns number | null

    A number from 1 to 65535.

getRequestedHost

  • getRequestedHost(): string | null
  • Returns the host that was requested for this connection via setServer(). If that host is a load balancing DNS server, the actual host used for the connection (as returned by getHost()) might differ from the requested host.

    Returns string | null

    The requested host name or ip, as a string.

getSendDelay

  • getSendDelay(): number
  • Returns this connection's send-delay. For details, see setSendDelay().

    Returns number

getType

  • getType(): string | null
  • Returns the type of the connection, as one of the types specified by the ConnectionType class.

    Returns string | null

    A string representing the connection type.

hasListener

  • hasListener(type: string, listener: Function, thisArg: any): boolean
  • Parameters

    • type: string
    • listener: Function
    • thisArg: any

    Returns boolean

helloCompleteListener

  • helloCompleteListener(data: string): void

helloErrorListener

  • helloErrorListener(): void

incomingCompleteListener

  • incomingCompleteListener(data: string): void

incomingErrorListener

  • incomingErrorListener(): void

isReady

  • isReady(): boolean

isValid

  • isValid(): boolean
  • Indicates whether this connection is considered valid. Valid connections are those that are currently in a "ready" state, or are currently disconnected but successfully achieved a "ready" state in the most recent connection attempt.

    Returns boolean

outgoingCompleteListener

  • outgoingCompleteListener(): void

outgoingErrorListener

  • outgoingErrorListener(): void

removeEventListener

  • removeEventListener(type: string, listener: Function, thisArg: any): boolean
  • Parameters

    • type: string
    • listener: Function
    • thisArg: any

    Returns boolean

retryIncoming

  • retryIncoming(): void

send

  • send(data: string): void

setOrbiter

  • setOrbiter(orbiter: Orbiter): void
  • Assigns the Orbiter object for which this IConnection will provide server communication services. This method is invoked automatically by the ConnectionManager when the Connection object is added to the ConnectionManager's connection list.

    Parameters

    Returns void

setRetryDelay

  • setRetryDelay(milliseconds: number): void

setSendDelay

  • setSendDelay(milliseconds: number): void
  • Increases or decreases the connection's batch-message send rate, or disables batch-sending entirely. Orbiter's HTTPConnection class uses a batch-message-sending system that reduces server load and client-side HTTP-request volume. In the default configuration, when an HTTPConnection sends messages via an HTTP request to Union Server, it starts a countdown known as the "send-countdown". The duration of the send-countdown is known as the "send-delay" (configurable via the setSendDelay() method). Until both the send-countdown expires and the response to the HTTP request is received, all outbound messages are queued. The queue is flushed when both the outbound HTTP request has completed and the send-countdown (if any) has expired.

    Orbiter's batch-message-sending system is part of Union's "binary request" HTTP communications model, which balances two principles: on one hand, for maximum responsiveness, Orbiter always maintains an open HTTP request to Union Server (used to receive incoming messages from the server); on the other hand, for maximum efficiency, when an outgoing HTTP response is already pending, Orbiter never sends another request, and when no outgoing HTTP response is pending, Orbiter never sends messages to Union Server more frequently than the specified send-delay.

    The default send-delay is defined by HTTPConnection.DEFAULT_SEND_DELAY, and is appropriate for the vast majority of applications. However, applications that require a reduced server load can opt for less frequent message delivery by increasing the send-delay. Conversely, applications that require maximum responsiveness can opt for more frequent message delivery by decreasing the send-delay, or by setting the send-delay to -1, which disables the message queue entirely. When the message queue is disabled, a new outgoing HTTP request will be opened any time there are messages to send and there is no outgoing request already pending.

    Warning: disabling the send-delay or setting it to a value lower than 200 milliseconds can result high server load. When setting send-delay to a custom value, be sure to test application behaviour thoroughly.

    Parameters

    Returns void

setServer

  • setServer(host: string, port: number): void

toString

  • toString(): string

transmitHelloMessage

  • transmitHelloMessage(helloString: string): void
  • Transmits the client hello to the server, bypassing the usual send call because the first request has no session id, so the Binary Request Communication Model cannot yet be used.

    Parameters

    • helloString: string

    Returns void

Static helloRequestErrorListener

Static helloRequestReadystatechangeListener

Static incomingRequestErrorListener

Static incomingRequestReadystatechangeListener

  • incomingRequestReadystatechangeListener(xhr: XMLHttpRequest, connection: HTTPDirectConnection): void

Static outgoingRequestErrorListener

Static outgoingRequestReadystatechangeListener

  • outgoingRequestReadystatechangeListener(xhr: XMLHttpRequest, connection: HTTPDirectConnection): void