📄 jxtasocket.html
字号:
<HR><A NAME="JxtaSocket(net.jxta.peergroup.PeerGroup, net.jxta.protocol.PipeAdvertisement, int)"><!-- --></A><H3>JxtaSocket</H3><PRE>public <B>JxtaSocket</B>(<A HREF="../../../net/jxta/peergroup/PeerGroup.html" title="interface in net.jxta.peergroup">PeerGroup</A> group, <A HREF="../../../net/jxta/protocol/PipeAdvertisement.html" title="class in net.jxta.protocol">PipeAdvertisement</A> pipeAd, int timeout) throws java.io.IOException</PRE><DL><DD>Create a JxtaSocket to any peer listening on pipeAdv this attempts establish a connection to specified pipe within the context of the specified group within timeout specified in milliseconds<P><DT><B>Parameters:</B><DD><CODE>group</CODE> - group context<DD><CODE>timeout</CODE> - JxtaSocket timeout in miliseconds<DT><B>Throws:</B><DD><CODE>java.io.IOException</CODE> - if an io error occurs</DL><HR><A NAME="JxtaSocket(net.jxta.peergroup.PeerGroup, net.jxta.peer.PeerID, net.jxta.protocol.PipeAdvertisement, int)"><!-- --></A><H3>JxtaSocket</H3><PRE>public <B>JxtaSocket</B>(<A HREF="../../../net/jxta/peergroup/PeerGroup.html" title="interface in net.jxta.peergroup">PeerGroup</A> group, <A HREF="../../../net/jxta/peer/PeerID.html" title="class in net.jxta.peer">PeerID</A> peerid, <A HREF="../../../net/jxta/protocol/PipeAdvertisement.html" title="class in net.jxta.protocol">PipeAdvertisement</A> pipeAd, int timeout) throws java.io.IOException</PRE><DL><DD>Create a JxtaSocket to any peer listening on pipeAdv this attempts establish a connection to specified pipe within a context of group and within timeout specified in milliseconds<P><DT><B>Parameters:</B><DD><CODE>group</CODE> - group context<DD><CODE>peerid</CODE> - peer to connect to<DD><CODE>timeout</CODE> - JxtaSocket timeout in miliseconds<DT><B>Throws:</B><DD><CODE>java.io.IOException</CODE> - if an io error occurs</DL><HR><A NAME="JxtaSocket(net.jxta.peergroup.PeerGroup, net.jxta.peer.PeerID, net.jxta.protocol.PipeAdvertisement, int, boolean)"><!-- --></A><H3>JxtaSocket</H3><PRE>public <B>JxtaSocket</B>(<A HREF="../../../net/jxta/peergroup/PeerGroup.html" title="interface in net.jxta.peergroup">PeerGroup</A> group, <A HREF="../../../net/jxta/peer/PeerID.html" title="class in net.jxta.peer">PeerID</A> peerid, <A HREF="../../../net/jxta/protocol/PipeAdvertisement.html" title="class in net.jxta.protocol">PipeAdvertisement</A> pipeAd, int timeout, boolean stream) throws java.io.IOException</PRE><DL><DD>Create a JxtaSocket to any peer listening on pipeAdv this attempts establish a connection to specified pipe within a context of group and within timeout specified in milliseconds<P><DT><B>Parameters:</B><DD><CODE>group</CODE> - group context<DD><CODE>peerid</CODE> - peer to connect to<DD><CODE>timeout</CODE> - JxtaSocket timeout in miliseconds<DT><B>Throws:</B><DD><CODE>java.io.IOException</CODE> - if an io error occurs</DL><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Method Detail</B></FONT></TD></TR></TABLE><A NAME="create(boolean)"><!-- --></A><H3>create</H3><PRE>public void <B>create</B>(boolean stream) throws java.io.IOException</PRE><DL><DD>Creates either a stream or a datagram socket. default is a datagram<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>stream</CODE> - if <code>true</code>, create a stream socket; otherwise, create a datagram socket.<DT><B>Throws:</B><DD><CODE>java.io.IOException</CODE> - if an I/O error occurs while creating the socket.</DL></DD></DL><HR><A NAME="connect(net.jxta.peergroup.PeerGroup, net.jxta.protocol.PipeAdvertisement)"><!-- --></A><H3>connect</H3><PRE>public void <B>connect</B>(<A HREF="../../../net/jxta/peergroup/PeerGroup.html" title="interface in net.jxta.peergroup">PeerGroup</A> group, <A HREF="../../../net/jxta/protocol/PipeAdvertisement.html" title="class in net.jxta.protocol">PipeAdvertisement</A> pipeAd) throws java.io.IOException</PRE><DL><DD>Connects to a remote JxtaSocket on any peer within the default timeout of 60 seconds<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>group</CODE> - group context<DD><CODE>pipeAd</CODE> - PipeAdvertisement<DT><B>Throws:</B><DD><CODE>java.io.IOException</CODE> - if an io error occurs</DL></DD></DL><HR><A NAME="connect(net.jxta.peergroup.PeerGroup, net.jxta.protocol.PipeAdvertisement, int)"><!-- --></A><H3>connect</H3><PRE>public void <B>connect</B>(<A HREF="../../../net/jxta/peergroup/PeerGroup.html" title="interface in net.jxta.peergroup">PeerGroup</A> group, <A HREF="../../../net/jxta/protocol/PipeAdvertisement.html" title="class in net.jxta.protocol">PipeAdvertisement</A> pipeAd, int timeout) throws java.io.IOException</PRE><DL><DD>Connects to a remote JxtaSocket on any peer within a timeout specified in milliseconds<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>group</CODE> - group context<DT><B>Throws:</B><DD><CODE>java.io.IOException</CODE> - if an io error occurs</DL></DD></DL><HR><A NAME="connect(net.jxta.peergroup.PeerGroup, net.jxta.peer.PeerID, net.jxta.protocol.PipeAdvertisement, int)"><!-- --></A><H3>connect</H3><PRE>public void <B>connect</B>(<A HREF="../../../net/jxta/peergroup/PeerGroup.html" title="interface in net.jxta.peergroup">PeerGroup</A> group, <A HREF="../../../net/jxta/peer/PeerID.html" title="class in net.jxta.peer">PeerID</A> peerid, <A HREF="../../../net/jxta/protocol/PipeAdvertisement.html" title="class in net.jxta.protocol">PipeAdvertisement</A> pipeAd, int timeout) throws java.io.IOException</PRE><DL><DD>Connects to a remote JxtaSocket on a specific peer within a timeout specified in milliseconds<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>group</CODE> - group context<DD><CODE>peerid</CODE> - peer to connect to<DD><CODE>timeout</CODE> - timeout in ms<DT><B>Throws:</B><DD><CODE>java.io.IOException</CODE> - if an io error occurs</DL></DD></DL><HR><A NAME="getCredDoc(net.jxta.peergroup.PeerGroup)"><!-- --></A><H3>getCredDoc</H3><PRE>protected static <A HREF="../../../net/jxta/document/StructuredDocument.html" title="interface in net.jxta.document">StructuredDocument</A> <B>getCredDoc</B>(<A HREF="../../../net/jxta/peergroup/PeerGroup.html" title="interface in net.jxta.peergroup">PeerGroup</A> group)</PRE><DL><DD>obtain the cred doc from the group object<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>group</CODE> - group context<DT><B>Returns:</B><DD>The credDoc value</DL></DD></DL><HR><A NAME="createOpenMessage(net.jxta.peergroup.PeerGroup, net.jxta.protocol.PipeAdvertisement)"><!-- --></A><H3>createOpenMessage</H3><PRE>protected <A HREF="../../../net/jxta/endpoint/Message.html" title="class in net.jxta.endpoint">Message</A> <B>createOpenMessage</B>(<A HREF="../../../net/jxta/peergroup/PeerGroup.html" title="interface in net.jxta.peergroup">PeerGroup</A> group, <A HREF="../../../net/jxta/protocol/PipeAdvertisement.html" title="class in net.jxta.protocol">PipeAdvertisement</A> pipeAd)</PRE><DL><DD>Create a connection request message<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>group</CODE> - group context<DD><CODE>pipeAd</CODE> - pipe advertisement<DT><B>Returns:</B><DD>the Message object</DL></DD></DL><HR><A NAME="listen(int)"><!-- --></A><H3>listen</H3><PRE>public void <B>listen</B>(int backlog) throws java.io.IOException</PRE><DL><DD>Sets the maximum queue length for incoming connection indications (a request to connect) to the <code>count</code> argument. If a connection indication arrives when the queue is full, the connection is refused.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>backlog</CODE> - the maximum length of the queue.<DT><B>Throws:</B><DD><CODE>java.io.IOException</CODE> - if an I/O error occurs when creating the queue.</DL></DD></DL><HR><A NAME="isBound()"><!-- --></A><H3>isBound</H3><PRE>public boolean <B>isBound</B>()</PRE><DL><DD>Returns the binding state of the JxtaServerSocket.<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>true if the ServerSocket succesfuly bound to an address</DL></DD></DL><HR><A NAME="getOutputStreamBufferSize()"><!-- --></A><H3>getOutputStreamBufferSize</H3><PRE>public int <B>getOutputStreamBufferSize</B>()</PRE><DL><DD>Returns the OutputStream buffer size<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>returns output buffer size</DL></DD></DL><HR><A NAME="setOutputStreamBufferSize(int)"><!-- --></A><H3>setOutputStreamBufferSize</H3><PRE>public void <B>setOutputStreamBufferSize</B>(int size) throws java.io.IOException</PRE><DL><DD>Sets the OutputStream buffer size this operation is only valid prior to any call to getOutputStream<P><DD><DL></DL></DD><DD><DL><DT><B>Throws:</B><DD><CODE>java.io.IOException</CODE></DL></DD></DL><HR><A NAME="getInputStream()"><!-- --></A><H3>getInputStream</H3><PRE>public java.io.InputStream <B>getInputStream</B>() throws java.io.IOException</PRE><DL><DD>Returns an input stream for this socket.<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>a stream for reading from this socket.<DT><B>Throws:</B><DD><CODE>java.io.IOException</CODE> - if an I/O error occurs when creating the input stream.</DL></DD></DL><HR><A NAME="getOutputStream()"><!-- --></A><H3>getOutputStream</H3><PRE>public java.io.OutputStream <B>getOutputStream</B>() throws java.io.IOException</PRE><DL><DD>Returns an output stream for this socket.<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>an output stream for writing to this socket.<DT><B>Throws:</B><DD><CODE>java.io.IOException</CODE> - if an I/O error occurs when creating the output stream.</DL></DD></DL><HR><A NAME="close()"><!-- --></A><H3>close</H3><PRE>public void <B>close</B>() throws java.io.IOException</PRE><DL><DD>Closes this socket.<P><DD><DL></DL></DD><DD><DL><DT><B>Throws:</B><DD><CODE>java.io.IOException</CODE> - if an I/O error occurs when closing this socket.</DL></DD></DL><HR><A NAME="closeFromRemote()"><!-- --></A><H3>closeFromRemote</H3><PRE>protected void <B>closeFromRemote</B>() throws java.io.IOException</PRE><DL><DD>This is called when closure is initiated on the remote side. output is closed without any precaution since the remote side is no longer interrested, but let the input drain, so that all the packets the other side flushed before closing have been actually delivered.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -