nsISocketProvider 编辑
netwerk/socket/nsISocketProvider.idl
Scriptable This interface represents a socket provider. It is implemented by several types of socket classes like: UDP, SOCKS, TLS, SSL, and so on. Inherits from: nsISupports
Last changed in Gecko 1.9.1 (Firefox 3.5 / Thunderbird 3.0 / SeaMonkey 2.0)Implemented by: @mozilla.org/network/socket;2?type=foo
. To create an instance, use:
var socketProvider = Components.classes["@mozilla.org/network/socket;2?type="] .createInstance(Components.interfaces.nsISocketProvider);
Method overview
void addToSocket(in long aFamily, in string aHost, in long aPort, in string aProxyHost, in long aProxyPort, in unsigned long aFlags, in PRFileDescStar aFileDesc, out nsISupports aSecurityInfo); Native code only! |
void newSocket(in long aFamily, in string aHost, in long aPort, in string aProxyHost, in long aProxyPort, in unsigned long aFlags, out PRFileDescStar aFileDesc, out nsISupports aSecurityInfo); Native code only! |
Constants
Constant | Value | Description |
PROXY_RESOLVES_HOST | 1 << 0 | This flag is set if the proxy is to perform hostname resolution instead of the client. When set, the hostname parameter passed in this interface will be used instead of the address structure passed for a later request. |
ANONYMOUS_CONNECT | 1 << 1 | When setting this flag, the socket will not apply any credentials when establishing a connection. For example, an SSL connection would not send any client-certificates if this flag is set. |
Methods
Native code only!addToSocket
This function is called to allow the socket provider to layer a PRFileDesc
(a file descriptor) on top of another PRFileDesc
. For example, SSL via a SOCKS proxy.
Parameters are the same as newSocket()
with the exception of aFileDesc
, which is an input parameter instead.
void addToSocket( in long aFamily, in string aHost, in long aPort, in string aProxyHost, in long aProxyPort, in unsigned long aFlags, in PRFileDescStar aFileDesc, out nsISupports aSecurityInfo );
Parameters
aFamily
- The address family for this socket (
PR_AF_INET
orPR_AF_INET6
). aHost
- The hostname for this connection.
aPort
- The port for this connection.
aProxyHost
- If non-
null
, the proxy hostname for this connection. aProxyPort
- The proxy port for this connection.
aFlags
- Control flags that govern this connection (see Constants).
aFileDesc
- The existing
PRFileDesc
. aSecurityInfo
- Any security info that should be associated with
aFileDesc
. This object typically implementsnsITransportSecurityInfo
.
newSocket
Creates a new socket.
void newSocket( in long aFamily, in string aHost, in long aPort, in string aProxyHost, in long aProxyPort, in unsigned long aFlags, out PRFileDescStar aFileDesc, out nsISupports aSecurityInfo );
Parameters
aFamily
- The address family for this socket (
PR_AF_INET
or PR_AF_INET6). aHost
- The hostname for this connection.
aPort
- The port for this connection.
aProxyHost
- If non-
null
, the proxy hostname for this connection. aProxyPort
- The proxy port for this connection.
aFlags
- Control flags that govern this connection (see Constants)
aFileDesc
- The resulting
PRFileDesc
. aSecurityInfo
- Any security info that should be associated with
aFileDesc
. This object typically implementsnsITransportSecurityInfo
.
See also
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论