Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Public Attributes
nsISocketTransport Interface Reference

nsISocketTransport More...

import "nsISocketTransport.idl";

Inheritance diagram for nsISocketTransport:
Inheritance graph
[legend]
Collaboration diagram for nsISocketTransport:
Collaboration graph
[legend]

List of all members.

Public Member Functions

PRNetAddr getPeerAddr ()
 Returns the IP address of the socket connection peer.
PRNetAddr getSelfAddr ()
 Returns the IP address of the initiating end.
boolean isAlive ()
 Test if this socket transport is (still) connected.
unsigned long getTimeout (in unsigned long aType)
 Socket timeouts in seconds.
void setTimeout (in unsigned long aType, in unsigned long aValue)
nsIInputStream openInputStream (in unsigned long aFlags, in unsigned long aSegmentSize, in unsigned long aSegmentCount)
 Open an input stream on this transport.
nsIOutputStream openOutputStream (in unsigned long aFlags, in unsigned long aSegmentSize, in unsigned long aSegmentCount)
 Open an output stream on this transport.
void close (in nsresult aReason)
 Close the transport and any open streams.
void setEventSink (in nsITransportEventSink aSink, in nsIEventTarget aEventTarget)
 Set the transport event sink.

Public Attributes

readonly attribute AUTF8String host
 Get the host for the underlying socket connection.
readonly attribute long port
 Get the port for the underlying socket connection.
readonly attribute nsISupports securityInfo
 Security info object returned from the secure socket provider.
attribute nsIInterfaceRequestor securityCallbacks
 Security notification callbacks passed to the secure socket provider via nsISSLSocketControl at socket creation time.
const unsigned long TIMEOUT_CONNECT = 0
 Values for the aType parameter passed to get/setTimeout.
const unsigned long TIMEOUT_READ_WRITE = 1
const unsigned long STATUS_RESOLVING = 0x804b0003
 nsITransportEventSink status codes.
const unsigned long STATUS_CONNECTING_TO = 0x804b0007
const unsigned long STATUS_CONNECTED_TO = 0x804b0004
const unsigned long STATUS_SENDING_TO = 0x804b0005
const unsigned long STATUS_WAITING_FOR = 0x804b000a
const unsigned long STATUS_RECEIVING_FROM = 0x804b0006
const unsigned long OPEN_BLOCKING = 1<<0
 Open flags.
const unsigned long OPEN_UNBUFFERED = 1<<1
const unsigned long STATUS_READING = 0x804b0008
 Generic nsITransportEventSink status codes.
const unsigned long STATUS_WRITING = 0x804b0009

Detailed Description

nsISocketTransport

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

Definition at line 52 of file nsISocketTransport.idl.


Member Function Documentation

void nsITransport::close ( in nsresult  aReason) [inherited]

Close the transport and any open streams.

Parameters:
aReasonthe reason for closing the stream.

Returns the IP address of the socket connection peer.

This attribute is defined only once a connection has been established.

Returns the IP address of the initiating end.

This attribute is defined only once a connection has been established.

unsigned long nsISocketTransport::getTimeout ( in unsigned long  aType)

Socket timeouts in seconds.

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

Test if this socket transport is (still) connected.

nsIInputStream nsITransport::openInputStream ( in unsigned long  aFlags,
in unsigned long  aSegmentSize,
in unsigned long  aSegmentCount 
) [inherited]

Open an input stream on this transport.

Flags have the following meaning:

OPEN_BLOCKING If specified, then the resulting stream will have blocking stream semantics. This means that if the stream has no data and is not closed, then reading from it will block the calling thread until at least one byte is available or until the stream is closed. If this flag is NOT specified, then the stream has non-blocking stream semantics. This means that if the stream has no data and is not closed, then reading from it returns NS_BASE_STREAM_WOULD_BLOCK. In addition, in non-blocking mode, the stream is guaranteed to support nsIAsyncInputStream. This interface allows the consumer of the stream to be notified when the stream can again be read.

OPEN_UNBUFFERED If specified, the resulting stream may not support ReadSegments. ReadSegments is only gauranteed to be implemented when this flag is NOT specified.

Parameters:
aFlagsoptional transport specific flags.
aSegmentSizeif OPEN_UNBUFFERED is not set, then this parameter specifies the size of each buffer segment (pass 0 to use default value).
aSegmentCountif OPEN_UNBUFFERED is not set, then this parameter specifies the maximum number of buffer segments (pass 0 to use default value).
nsIOutputStream nsITransport::openOutputStream ( in unsigned long  aFlags,
in unsigned long  aSegmentSize,
in unsigned long  aSegmentCount 
) [inherited]

Open an output stream on this transport.

Flags have the following meaning:

OPEN_BLOCKING If specified, then the resulting stream will have blocking stream semantics. This means that if the stream is full and is not closed, then writing to it will block the calling thread until ALL of the data can be written or until the stream is closed. If this flag is NOT specified, then the stream has non-blocking stream semantics. This means that if the stream is full and is not closed, then writing to it returns NS_BASE_STREAM_WOULD_BLOCK. In addition, in non- blocking mode, the stream is guaranteed to support nsIAsyncOutputStream. This interface allows the consumer of the stream to be notified when the stream can again accept more data.

OPEN_UNBUFFERED If specified, the resulting stream may not support WriteSegments and WriteFrom. WriteSegments and WriteFrom are only gauranteed to be implemented when this flag is NOT specified.

Parameters:
aFlagsoptional transport specific flags.
aSegmentSizeif OPEN_UNBUFFERED is not set, then this parameter specifies the size of each buffer segment (pass 0 to use default value).
aSegmentCountif OPEN_UNBUFFERED is not set, then this parameter specifies the maximum number of buffer segments (pass 0 to use default value).
void nsITransport::setEventSink ( in nsITransportEventSink  aSink,
in nsIEventTarget  aEventTarget 
) [inherited]

Set the transport event sink.

Parameters:
aSinkreceives transport layer notifications
aEventTargetindicates the event target to which the notifications should be delivered. if NULL, then the notifications may occur on any thread.
void nsISocketTransport::setTimeout ( in unsigned long  aType,
in unsigned long  aValue 
)

Member Data Documentation

readonly attribute AUTF8String nsISocketTransport::host

Get the host for the underlying socket connection.

Definition at line 57 of file nsISocketTransport.idl.

const unsigned long nsITransport::OPEN_BLOCKING = 1<<0 [inherited]

Open flags.

Definition at line 66 of file nsITransport.idl.

const unsigned long nsITransport::OPEN_UNBUFFERED = 1<<1 [inherited]

Definition at line 67 of file nsITransport.idl.

Get the port for the underlying socket connection.

Definition at line 62 of file nsISocketTransport.idl.

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.

Definition at line 89 of file nsISocketTransport.idl.

Security info object returned from the secure socket provider.

This object supports nsISSLSocketControl, nsITransportSecurityInfo, and possibly other interfaces.

Definition at line 81 of file nsISocketTransport.idl.

Definition at line 128 of file nsISocketTransport.idl.

Definition at line 127 of file nsISocketTransport.idl.

const unsigned long nsITransport::STATUS_READING = 0x804b0008 [inherited]

Generic nsITransportEventSink status codes.

nsITransport implementations may override these status codes with their own more specific status codes (e.g., see nsISocketTransport).

Definition at line 165 of file nsITransport.idl.

Definition at line 131 of file nsISocketTransport.idl.

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.

Definition at line 126 of file nsISocketTransport.idl.

Definition at line 129 of file nsISocketTransport.idl.

Definition at line 130 of file nsISocketTransport.idl.

const unsigned long nsITransport::STATUS_WRITING = 0x804b0009 [inherited]

Definition at line 166 of file nsITransport.idl.

Values for the aType parameter passed to get/setTimeout.

Definition at line 107 of file nsISocketTransport.idl.

Definition at line 108 of file nsISocketTransport.idl.


The documentation for this interface was generated from the following file: