📄 jxtaserversocket.html
字号:
JxtaServerSocket</H3><PRE>public <B>JxtaServerSocket</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> pipeadv, int backlog, int timeout) throws java.io.IOException</PRE><DL><DD>Constructor for the JxtaServerSocket object <p> The timeout defaults to 0, i.e. blocking.<P><DT><B>Parameters:</B><DD><CODE>group</CODE> - JXTA PeerGroup<DD><CODE>pipeadv</CODE> - PipeAdvertisement on which pipe requests are accepted<DD><CODE>backlog</CODE> - the maximum length of the queue.<DD><CODE>timeout</CODE> - the specified timeout, in milliseconds<DT><B>Throws:</B><DD><CODE>java.io.IOException</CODE> - if an I/O 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="bind(net.jxta.peergroup.PeerGroup, net.jxta.protocol.PipeAdvertisement)"><!-- --></A><H3>bind</H3><PRE>public void <B>bind</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> pipeadv) throws java.io.IOException</PRE><DL><DD>Binds the <code>JxtaServerSocket</code> to a specific pipe advertisement<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>group</CODE> - JXTA PeerGroup<DD><CODE>pipeadv</CODE> - PipeAdvertisement on which pipe requests are accepted<DT><B>Throws:</B><DD><CODE>java.io.IOException</CODE> - if an I/O error occurs</DL></DD></DL><HR><A NAME="bind(net.jxta.peergroup.PeerGroup, net.jxta.protocol.PipeAdvertisement, int)"><!-- --></A><H3>bind</H3><PRE>public void <B>bind</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> pipeadv, int backlog) throws java.io.IOException</PRE><DL><DD>Binds the <code>JxtaServerSocket</code> to a specific pipe advertisement<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>group</CODE> - JXTA PeerGroup<DD><CODE>pipeadv</CODE> - PipeAdvertisement on which pipe requests are accepted<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</DL></DD></DL><HR><A NAME="accept()"><!-- --></A><H3>accept</H3><PRE>public <A HREF="../../../net/jxta/socket/JxtaSocket.html" title="class in net.jxta.socket">JxtaSocket</A> <B>accept</B>() throws java.io.IOException</PRE><DL><DD>Listens for a connection to be made to this socket and accepts it. The method blocks until a connection is made, unless the timeout has been previously set.<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>JxtaSocket<DT><B>Throws:</B><DD><CODE>java.io.IOException</CODE> - if an I/O error occurs</DL></DD></DL><HR><A NAME="getGroup()"><!-- --></A><H3>getGroup</H3><PRE>public <A HREF="../../../net/jxta/peergroup/PeerGroup.html" title="interface in net.jxta.peergroup">PeerGroup</A> <B>getGroup</B>()</PRE><DL><DD>Gets the group associted with this JxtaServerSocket object<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>The group value</DL></DD></DL><HR><A NAME="getPipeAdv()"><!-- --></A><H3>getPipeAdv</H3><PRE>public <A HREF="../../../net/jxta/protocol/PipeAdvertisement.html" title="class in net.jxta.protocol">PipeAdvertisement</A> <B>getPipeAdv</B>()</PRE><DL><DD>Gets the PipeAdvertisement associatedwith this JxtaServerSocket object<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>The pipeAdv value</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. Closes this socket, erasing queue of connection requests.<P><DD><DL></DL></DD><DD><DL><DT><B>Throws:</B><DD><CODE>java.io.IOException</CODE> - if an I/O error occurs</DL></DD></DL><HR><A NAME="setBound()"><!-- --></A><H3>setBound</H3><PRE>protected void <B>setBound</B>()</PRE><DL><DD>Sets the bound attribute of the JxtaServerSocket object<P><DD><DL></DL></DD><DD><DL></DL></DD></DL><HR><A NAME="getSoTimeout()"><!-- --></A><H3>getSoTimeout</H3><PRE>public int <B>getSoTimeout</B>() throws java.io.IOException</PRE><DL><DD>Gets the Timeout attribute of the JxtaServerSocket object, specified in milliseconds.<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>The socket timeout value, in milliseconds<DT><B>Throws:</B><DD><CODE>java.io.IOException</CODE> - if an I/O error occurs</DL></DD></DL><HR><A NAME="setSoTimeout(int)"><!-- --></A><H3>setSoTimeout</H3><PRE>public void <B>setSoTimeout</B>(int timeout) throws java.net.SocketException</PRE><DL><DD>Sets the Timeout attribute of the JxtaServerSocket, specified in milliseconds. A timeout of 0 blocks forever, by default timeout is set to 60000<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>timeout</CODE> - The new soTimeout value<DT><B>Throws:</B><DD><CODE>java.io.IOException</CODE> - if an I/O error occurs<DD><CODE>java.net.SocketException</CODE></DL></DD></DL><HR><A NAME="isClosed()"><!-- --></A><H3>isClosed</H3><PRE>public boolean <B>isClosed</B>()</PRE><DL><DD>Returns the closed state of the JxtaServerSocket.<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>true if the socket has been closed</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="pipeMsgEvent(net.jxta.pipe.PipeMsgEvent)"><!-- --></A><H3>pipeMsgEvent</H3><PRE>public void <B>pipeMsgEvent</B>(<A HREF="../../../net/jxta/pipe/PipeMsgEvent.html" title="class in net.jxta.pipe">PipeMsgEvent</A> event)</PRE><DL><DD>when request messages arrive this method is called<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../net/jxta/pipe/PipeMsgListener.html#pipeMsgEvent(net.jxta.pipe.PipeMsgEvent)">pipeMsgEvent</A></CODE> in interface <CODE><A HREF="../../../net/jxta/pipe/PipeMsgListener.html" title="interface in net.jxta.pipe">PipeMsgListener</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>event</CODE> - the pipe message event</DL></DD></DL><HR><A NAME="sendResponseMessage(net.jxta.peergroup.PeerGroup, net.jxta.endpoint.Messenger, net.jxta.protocol.PipeAdvertisement)"><!-- --></A><H3>sendResponseMessage</H3><PRE>protected void <B>sendResponseMessage</B>(<A HREF="../../../net/jxta/peergroup/PeerGroup.html" title="interface in net.jxta.peergroup">PeerGroup</A> group, <A HREF="../../../net/jxta/endpoint/Messenger.html" title="interface in net.jxta.endpoint">Messenger</A> msgr, <A HREF="../../../net/jxta/protocol/PipeAdvertisement.html" title="class in net.jxta.protocol">PipeAdvertisement</A> pipeAd) throws java.io.IOException</PRE><DL><DD>Method sendResponseMessage get the createResponseMessage and sends it.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>group</CODE> - <DD><CODE>msgr</CODE> - <DD><CODE>pipeAd</CODE> - <DT><B>Returns:</B><DD>Message The value of createResponseMessage that was sent, or null<DT><B>Throws:</B><DD><CODE>java.io.IOException</CODE></DL></DD></DL><HR><A NAME="newInputPipe(net.jxta.peergroup.PeerGroup, net.jxta.protocol.PipeAdvertisement)"><!-- --></A><H3>newInputPipe</H3><PRE>protected static <A HREF="../../../net/jxta/protocol/PipeAdvertisement.html" title="class in net.jxta.protocol">PipeAdvertisement</A> <B>newInputPipe</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> pipeadv)</PRE><DL><DD>Utility method newInputPipe is used to get new pipe advertisement (w/random pipe ID) from old one. <p> Called by JxtaSocket to make pipe (name -> name.remote) for open message <p> Called by JxtaServerSocket to make pipe (name.remote -> name.remote.remote) for response message<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>group</CODE> - <DD><CODE>pipeadv</CODE> - to get the basename and type from<DT><B>Returns:</B><DD>PipeAdvertisement a new pipe advertisement</DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ======= START OF BOTTOM NAVBAR ====== --><A NAME="navbar_bottom"><!-- --></A><A HREF="#skip-navbar_bottom" title="Skip navigation links"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""><TR><TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/JxtaServerSocket.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>JXTA J2SE</EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../net/jxta/socket/JxtaMulticastSocket.html" title="class in net.jxta.socket"><B>PREV CLASS</B></A> <A HREF="../../../net/jxta/socket/JxtaSocket.html" title="class in net.jxta.socket"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html" target="_top"><B>FRAMES</B></A> <A HREF="JxtaServerSocket.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--></SCRIPT><NOSCRIPT> <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A></NOSCRIPT></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_bottom"></A><!-- ======== END OF BOTTOM NAVBAR ======= --><HR></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -