JSConnection


Properties

peerAddress

An JSAddress object specifying the peer address for this connection. This is writable only if the connection has never been connected. It may be null if the message associated with this connection was locally generated.

localAddress

An JSAddress object specifying the local address for this connection. It may be null if the message associated with this connection was locally generated. read-only

isConnected

A boolean value. True if the connection is currently open (connected). read-only

wasConnected

A boolean value. True if the connection was ever connected. read-only

ssl

A boolean value. True if the connection is (or will be) an ssl connection. Changing the value will also change the destination port if it had a default value (i.e. port 80 will be changed to 443, but port 8899 will not). This is only writable if the connection has never been connected.

sslSession

An SSLSession object containing the SSL session information (for SSL connections). If the connection is not ssl or not connected this is null.

Methods

close()

Close this connection. This has no effect if the connection is already closed or not yet open.

Example

// Change a connection to SSL
if (!con.wasConnected)
con.ssl = true;