⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 socketconnection.html

📁 开源软件openfire的API文件。进行openfire的二次开发所必需的工具。
💻 HTML
📖 第 1 页 / 共 5 页
字号:
</DL><HR><A NAME="registerCloseListener(org.jivesoftware.openfire.ConnectionCloseListener, java.lang.Object)"><!-- --></A><H3>registerCloseListener</H3><PRE>public void <B>registerCloseListener</B>(<A HREF="../../../../org/jivesoftware/openfire/ConnectionCloseListener.html" title="interface in org.jivesoftware.openfire">ConnectionCloseListener</A>&nbsp;listener,                                  <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A>&nbsp;handbackMessage)</PRE><DL><DD><B>Description copied from interface: <CODE><A HREF="../../../../org/jivesoftware/openfire/Connection.html#registerCloseListener(org.jivesoftware.openfire.ConnectionCloseListener, java.lang.Object)">Connection</A></CODE></B></DD><DD>Registers a listener for close event notification. Registrations after the Session is closed will be immediately notified <em>before</em> the registration call returns (within the context of the registration call). An optional handback object can be associated with the registration if the same listener is registered to listen for multiple connection closures.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../org/jivesoftware/openfire/Connection.html#registerCloseListener(org.jivesoftware.openfire.ConnectionCloseListener, java.lang.Object)">registerCloseListener</A></CODE> in interface <CODE><A HREF="../../../../org/jivesoftware/openfire/Connection.html" title="interface in org.jivesoftware.openfire">Connection</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>listener</CODE> - the listener to register for events.<DD><CODE>handbackMessage</CODE> - the object to send in the event notification.</DL></DD></DL><HR><A NAME="removeCloseListener(org.jivesoftware.openfire.ConnectionCloseListener)"><!-- --></A><H3>removeCloseListener</H3><PRE>public void <B>removeCloseListener</B>(<A HREF="../../../../org/jivesoftware/openfire/ConnectionCloseListener.html" title="interface in org.jivesoftware.openfire">ConnectionCloseListener</A>&nbsp;listener)</PRE><DL><DD><B>Description copied from interface: <CODE><A HREF="../../../../org/jivesoftware/openfire/Connection.html#removeCloseListener(org.jivesoftware.openfire.ConnectionCloseListener)">Connection</A></CODE></B></DD><DD>Removes a registered close event listener. Registered listeners must be able to receive close events up until the time this method returns. (i.e. it is possible to call unregister, receive a close event registration, and then have the unregister call return.)<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../org/jivesoftware/openfire/Connection.html#removeCloseListener(org.jivesoftware.openfire.ConnectionCloseListener)">removeCloseListener</A></CODE> in interface <CODE><A HREF="../../../../org/jivesoftware/openfire/Connection.html" title="interface in org.jivesoftware.openfire">Connection</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>listener</CODE> - the listener to deregister for close events.</DL></DD></DL><HR><A NAME="getAddress()"><!-- --></A><H3>getAddress</H3><PRE>public byte[] <B>getAddress</B>()                  throws <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/net/UnknownHostException.html" title="class or interface in java.net">UnknownHostException</A></PRE><DL><DD><B>Description copied from interface: <CODE><A HREF="../../../../org/jivesoftware/openfire/Connection.html#getAddress()">Connection</A></CODE></B></DD><DD>Returns the raw IP address of this <code>InetAddress</code> object. The result is in network byte order: the highest order byte of the address is in <code>getAddress()[0]</code>.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../org/jivesoftware/openfire/Connection.html#getAddress()">getAddress</A></CODE> in interface <CODE><A HREF="../../../../org/jivesoftware/openfire/Connection.html" title="interface in org.jivesoftware.openfire">Connection</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>the raw IP address of this object.<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/net/UnknownHostException.html" title="class or interface in java.net">UnknownHostException</A></CODE> - if IP address of host could not be determined.</DL></DD></DL><HR><A NAME="getHostAddress()"><!-- --></A><H3>getHostAddress</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>getHostAddress</B>()                      throws <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/net/UnknownHostException.html" title="class or interface in java.net">UnknownHostException</A></PRE><DL><DD><B>Description copied from interface: <CODE><A HREF="../../../../org/jivesoftware/openfire/Connection.html#getHostAddress()">Connection</A></CODE></B></DD><DD>Returns the IP address string in textual presentation.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../org/jivesoftware/openfire/Connection.html#getHostAddress()">getHostAddress</A></CODE> in interface <CODE><A HREF="../../../../org/jivesoftware/openfire/Connection.html" title="interface in org.jivesoftware.openfire">Connection</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>the raw IP address in a string format.<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/net/UnknownHostException.html" title="class or interface in java.net">UnknownHostException</A></CODE> - if IP address of host could not be determined.</DL></DD></DL><HR><A NAME="getHostName()"><!-- --></A><H3>getHostName</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>getHostName</B>()                   throws <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/net/UnknownHostException.html" title="class or interface in java.net">UnknownHostException</A></PRE><DL><DD><B>Description copied from interface: <CODE><A HREF="../../../../org/jivesoftware/openfire/Connection.html#getHostName()">Connection</A></CODE></B></DD><DD>Gets the host name for this IP address. <p>If this InetAddress was created with a host name, this host name will be remembered and returned; otherwise, a reverse name lookup will be performed and the result will be returned based on the system configured name lookup service. If a lookup of the name service is required, call <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/net/InetAddress.html#getCanonicalHostName()" title="class or interface in java.net"><CODE>getCanonicalHostName</CODE></A>. <p>If there is a security manager, its <code>checkConnect</code> method is first called with the hostname and <code>-1</code> as its arguments to see if the operation is allowed. If the operation is not allowed, it will return the textual representation of the IP address.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../org/jivesoftware/openfire/Connection.html#getHostName()">getHostName</A></CODE> in interface <CODE><A HREF="../../../../org/jivesoftware/openfire/Connection.html" title="interface in org.jivesoftware.openfire">Connection</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>the host name for this IP address, or if the operation    is not allowed by the security check, the textual    representation of the IP address.<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/net/UnknownHostException.html" title="class or interface in java.net">UnknownHostException</A></CODE> - if IP address of host could not be determined.<DT><B>See Also:</B><DD><A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/net/InetAddress.html#getCanonicalHostName()" title="class or interface in java.net"><CODE>InetAddress.getCanonicalHostName()</CODE></A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/SecurityManager.html#checkConnect(java.lang.String, int)" title="class or interface in java.lang"><CODE>SecurityManager.checkConnect(java.lang.String, int)</CODE></A></DL></DD></DL><HR><A NAME="getPort()"><!-- --></A><H3>getPort</H3><PRE>public int <B>getPort</B>()</PRE><DL><DD>Returns the port that the connection uses.<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the port that the connection uses.</DL></DD></DL><HR><A NAME="getWriter()"><!-- --></A><H3>getWriter</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/io/Writer.html" title="class or interface in java.io">Writer</A> <B>getWriter</B>()</PRE><DL><DD>Returns the Writer used to send data to the connection. The writer should be used with caution. In the majority of cases, the <A HREF="../../../../org/jivesoftware/openfire/net/SocketConnection.html#deliver(org.xmpp.packet.Packet)"><CODE>deliver(Packet)</CODE></A> method should be used to send data instead of using the writer directly. You must synchronize on the writer before writing data to it to ensure data consistency: <pre>  Writer writer = connection.getWriter(); synchronized(writer) {     // write data.... }</pre><P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the Writer for this connection.</DL></DD></DL><HR><A NAME="isClosed()"><!-- --></A><H3>isClosed</H3><PRE>public boolean <B>isClosed</B>()</PRE><DL><DD><B>Description copied from interface: <CODE><A HREF="../../../../org/jivesoftware/openfire/Connection.html#isClosed()">Connection</A></CODE></B></DD><DD>Returns true if the connection/session is closed.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../org/jivesoftware/openfire/Connection.html#isClosed()">isClosed</A></CODE> in interface <CODE><A HREF="../../../../org/jivesoftware/openfire/Connection.html" title="interface in org.jivesoftware.openfire">Connection</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>true if the connection is closed.</DL></DD></DL><HR><A NAME="isSecure()"><!-- --></A><H3>isSecure</H3><PRE>public boolean <B>isSecure</B>()</PRE><DL><DD><B>Description copied from interface: <CODE><A HREF="../../../../org/jivesoftware/openfire/Connection.html#isSecure()">Connection</A></CODE></B></DD><DD>Returns true if this connection is secure.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../org/jivesoftware/openfire/Connection.html#isSecure()">isSecure</A></CODE> in interface <CODE><A HREF="../../../../org/jivesoftware/openfire/Connection.html" title="interface in org.jivesoftware.openfire">Connection</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>true if the connection is secure (e.g. SSL/TLS)</DL></DD></DL><HR><A NAME="isCompressed()"><!-- --></A><H3>isCompressed</H3><PRE>public boolean <B>isCompressed</B>()</PRE><DL><DD><B>Description copied from interface: <CODE><A HREF="../../../../org/jivesoftware/openfire/Connection.html#isCompressed()">Connection</A></CODE></B></DD><DD>Returns true if the connection is using compression.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../org/jivesoftware/openfire/Connection.html#isCompressed()">isCompressed</A></CODE> in interface <CODE><A HREF="../../../../org/jivesoftware/openfire/Connection.html" title="interface in org.jivesoftware.openfire">Connection</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>true if the connection is using compression.</DL></DD></DL><HR><A NAME="getTlsPolicy()"><!-- --></A><H3>getTlsPolicy</H3><PRE>public <A HREF="../../../../org/jivesoftware/openfire/Connection.TLSPolicy.html" title="enum in org.jivesoftware.openfire">Connection.TLSPolicy</A> <B>getTlsPolicy</B>()</PRE><DL><DD><B>Description copied from interface: <CODE><A HREF="../../../../org/jivesoftware/openfire/Connection.html#getTlsPolicy()">Connection</A></CODE></B></DD><DD>Returns whether TLS is mandatory, optional or is disabled. When TLS is mandatory clients are required to secure their connections or otherwise their connections will be closed. On the other hand, when TLS is disabled clients are not allowed to secure their connections using TLS. Their connections will be closed if they try to secure the connection. in this last case.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../org/jivesoftware/openfire/Connection.html#getTlsPolicy()">getTlsPolicy</A></CODE> in interface <CODE><A HREF="../../../../org/jivesoftware/openfire/Connection.html" title="interface in org.jivesoftware.openfire">Connection</A></CODE></DL></DD>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -