Socket QoS/ToS markings. Valid values are IPTOS_DSCP_AFxx or IPTOS_CLASS_CSx (or IPTOS_DSCP_EF, but currently no supported services require expedited-forwarding). Not setting this value will leave the socket with the default ToS value, which on most systems if IPTOS_CLASS_CS0 (formerly IPTOS_PREC_ROUTINE).
connectionFlags is a bitmask that can be used to modify underlying behavior of the socket connection. See the flags below.
Readonly
echThis attribute holds information whether echConfig has been used. The value is set after PR_Connect is called.
Readonly
effectiveTRRModeReturns the effectiveTRRMode used for the DNS resolution.
Readonly
hostGet the peer's host for the underlying socket connection. For Unix domain sockets, this is a pathname, or the empty string for unnamed and abstract socket addresses.
TCP keepalive configuration (support varies by platform). Note that the attribute as well as the setter can only accessed in the socket thread.
The origin attributes are used to create sockets. The first party domain will eventually be used to isolate OCSP cache and is only non-empty when "privacy.firstparty.isolate" is enabled. Setting this is the only way to carry origin attributes down to NSPR layers which are final consumers. It must be set before the socket transport is built.
Readonly
portGet the port for the underlying socket connection. For Unix domain sockets, this is zero.
TCP send and receive buffer sizes. A value of 0 means OS level auto-tuning is in effect.
Readonly
resetIPFamilyIf true, this socket transport has found out the prefered family according it's connection flags could not be used to establish connections any more. Hence, the preference should be reset.
Readonly
retryIf DNS is performed externally, this flag informs the caller that it may retry connecting with a different DNS configuration (e.g. different IP family preference). The flag is set only if a network error is encounder, e.g. NS_ERROR_CONNECTION_REFUSED, NS_ERROR_RESET, etc.
Security notification callbacks passed to the secure socket provider via nsITLSSocketControl at socket creation time.
NOTE: this attribute cannot be changed once a stream has been opened.
Readonly
statusReturn the current status of the socket.
An opaque flags for non-standard behavior of the TLS system. It is unlikely this will need to be set outside of telemetry studies relating to the TLS implementation.
Readonly
tlsTLS socket control object. This attribute is only available once the socket is connected.
Readonly
trrReturns the TRR skip reason used for the DNS resolution.
Optional
aInstancePtr: objectA run time mechanism for interface discovery.
NS_OK if the interface is supported by the associated instance, NS_NOINTERFACE if it is not.
aInstancePtr must not be null.
[in] A requested interface IID
[out] A pointer to an interface pointer to receive the result.
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.
optional transport specific flags.
if OPEN_UNBUFFERED is not set, then this parameter specifies the size of each buffer segment (pass 0 to use default value).
if OPEN_UNBUFFERED is not set, then this parameter specifies the maximum number of buffer segments (pass 0 to use default value).
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 guaranteed to be implemented when this flag is NOT specified.
optional transport specific flags.
if OPEN_UNBUFFERED is not set, then this parameter specifies the size of each buffer segment (pass 0 to use default value).
if OPEN_UNBUFFERED is not set, then this parameter specifies the maximum number of buffer segments (pass 0 to use default value).
Set the transport event sink.
receives transport layer notifications
indicates the event target to which the notifications should be delivered. if NULL, then the notifications may occur on any thread.
Sets the SO_LINGER option with the specified values for the l_onoff and l_linger parameters. This applies PR_SockOpt_Linger before PR_Close and can be used with a timeout of zero to send an RST packet when closing.
Generated using TypeDoc
nsISocketTransport
NOTE: Connection setup is triggered by opening an input or output stream, it does not start on its own. Completion of the connection setup is indicated by a STATUS_CONNECTED_TO notification to the event sink (if set).
NOTE: This is a free-threaded interface, meaning that the methods on this interface may be called from any thread.