nsISocketTransport

IID:66418cc8-5f5d-4f52-a7f9-db8fb3b2cfe6
Inherits From:nsITransport

NOTE: This is a free-threaded interface, meaning that the methods on this interface may be called from any thread.


Constants

Values for the aType parameter passed to get/setTimeout.
PRUint32 TIMEOUT_CONNECT = 0
PRUint32 TIMEOUT_READ_WRITE = 1
nsITransportEventSink status codes.

Although these look like XPCOM error codes and are passed in an nsresult variable, they are *not* error codes. Note that while they *do* overlap with existing error codes in Necko, these status codes are confined within a very limited context where no error codes may appear, so there is no ambiguity.

The values of these status codes must never change.

The status codes appear in near-chronological order (not in numeric order). STATUS_RESOLVING may be skipped if the host does not need to be resolved. STATUS_WAITING_FOR is an optional status code, which the impl of this interface may choose not to generate.

PRUint32 STATUS_RESOLVING = -2142568445
PRUint32 STATUS_CONNECTING_TO = -2142568441
PRUint32 STATUS_CONNECTED_TO = -2142568444
PRUint32 STATUS_SENDING_TO = -2142568443
PRUint32 STATUS_WAITING_FOR = -2142568438
PRUint32 STATUS_RECEIVING_FROM = -2142568442

Properties

readonly AUTF8String host

Get the host for the underlying socket connection.

readonly PRInt32 port

Get the port for the underlying socket connection.

nsIInterfaceRequestor securityCallbacks

Security notification callbacks passed to the secure socket provider via nsISSLSocketControl at socket creation time.

NOTE: this attribute cannot be changed once a stream has been opened.

readonly nsISupports securityInfo

Security info object returned from the secure socket provider. This object supports nsISSLSocketControl, nsITransportSecurityInfo, and possibly other interfaces.


Methods

[noscript] PRNetAddr getPeerAddr ( ) [noscript] PRNetAddr getSelfAddr ( ) PRUint32 getTimeout ( PRUint32 type ) PRBool isAlive ( ) void setTimeout ( PRUint32 type , PRUint32 value )

PRNetAddr getPeerAddr ( )

Returns the IP address of the socket connection peer. This attribute is defined only once a connection has been established.


PRNetAddr getSelfAddr ( )

Returns the IP address of the initiating end. This attribute is defined only once a connection has been established.


PRUint32 getTimeout ( PRUint32 type )

Socket timeouts in seconds. To specify no timeout, pass PR_UINT32_MAX as value to setTimeout. The implementation may truncate timeout values to a smaller range of values (e.g., 0 to 0xFFFF).

Arguments:
type

PRBool isAlive ( )

Test if this socket transport is (still) connected.


void setTimeout ( PRUint32 type , PRUint32 value )

Arguments:
type
value

References

This interface is passed as an argument to the following methods:

nsIServerSocketListener.onSocketAccepted

This interface is returned from the following methods:

nsISocketTransportService.createTransport

Reference documentation is generated from Mozilla's source.

Add a note User Contributed Notes
No comments available

Copyright © 1999 - 2005 XULPlanet.com