📄 socketconnection.html
字号:
</TABLE>
<A NAME="methods_inherited_from_class_javax.microedition.io.InputConnection"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TD><B>Methods inherited from interface javax.microedition.io.<A HREF="../../../javax/microedition/io/InputConnection.html">InputConnection</A></B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../../javax/microedition/io/InputConnection.html#openDataInputStream()">openDataInputStream</A>, <A HREF="../../../javax/microedition/io/InputConnection.html#openInputStream()">openInputStream</A></CODE></TD>
</TR>
</TABLE>
<A NAME="methods_inherited_from_class_javax.microedition.io.Connection"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TD><B>Methods inherited from interface javax.microedition.io.<A HREF="../../../javax/microedition/io/Connection.html">Connection</A></B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../../javax/microedition/io/Connection.html#close()">close</A></CODE></TD>
</TR>
</TABLE>
<A NAME="methods_inherited_from_class_javax.microedition.io.OutputConnection"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TD><B>Methods inherited from interface javax.microedition.io.<A HREF="../../../javax/microedition/io/OutputConnection.html">OutputConnection</A></B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../../javax/microedition/io/OutputConnection.html#openDataOutputStream()">openDataOutputStream</A>, <A HREF="../../../javax/microedition/io/OutputConnection.html#openOutputStream()">openOutputStream</A></CODE></TD>
</TR>
</TABLE>
<P>
<!-- ============ FIELD DETAIL =========== -->
<A NAME="field_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Field Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="DELAY"><!-- --></A><H3>
DELAY</H3>
<PRE>
public static final byte <B>DELAY</B></PRE>
<DL>
<DD>Socket option for the small buffer <em>writing delay</em> (0). Set to zero to disable Nagle algorithm for small buffer operations. Set to a non-zero value to enable.</DL>
<HR>
<A NAME="LINGER"><!-- --></A><H3>
LINGER</H3>
<PRE>
public static final byte <B>LINGER</B></PRE>
<DL>
<DD>Socket option for the <em>linger time</em> to wait in seconds before closing a connection with pending data output (1). Setting the linger time to zero disables the linger wait interval.</DL>
<HR>
<A NAME="KEEPALIVE"><!-- --></A><H3>
KEEPALIVE</H3>
<PRE>
public static final byte <B>KEEPALIVE</B></PRE>
<DL>
<DD>Socket option for the <em>keep alive</em> feature (2). Setting KEEPALIVE to zero will disable the feature. Setting KEEPALIVE to a non-zero value will enable the feature.</DL>
<HR>
<A NAME="RCVBUF"><!-- --></A><H3>
RCVBUF</H3>
<PRE>
public static final byte <B>RCVBUF</B></PRE>
<DL>
<DD>Socket option for the size of the <em>receiving buffer</em> (3).</DL>
<HR>
<A NAME="SNDBUF"><!-- --></A><H3>
SNDBUF</H3>
<PRE>
public static final byte <B>SNDBUF</B></PRE>
<DL>
<DD>Socket option for the size of the <em>sending buffer</em> (4).</DL>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Method Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="setSocketOption(byte, int)"><!-- --></A><H3>
setSocketOption</H3>
<PRE>
public void <B>setSocketOption</B>(byte option, int value) throws <A HREF="../../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A>, <A HREF="../../../java/io/IOException.html">IOException</A></PRE>
<DL>
<DD>Set a socket option for the connection. <P> Options inform the low level networking code about intended usage patterns that the application will use in dealing with the socket connection. </P> <P> Calling <code>setSocketOption</code> to assign buffer sizes is a hint to the platform of the sizes to set the underlying network I/O buffers. Calling <code>getSocketOption</code> can be used to see what sizes the system is using. The system MAY adjust the buffer sizes to account for better throughput available from Maximum Transmission Unit (MTU) and Maximum Segment Size (MSS) data available from current network information. </P><DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>option</CODE> - socket option identifier (KEEPALIVE, LINGER, SNDBUF, RCVBUF, or DELAY)<DD><CODE>value</CODE> - numeric value for specified option<DT><B>Throws:</B><DD><CODE><A HREF="../../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - if the value is not valid (e.g. negative value) or if the option identifier is not valid<DD><CODE><A HREF="../../../java/io/IOException.html">IOException</A></CODE> - if the connection was closed<DT><B>See Also: </B><DD><A HREF="../../../javax/microedition/io/SocketConnection.html#getSocketOption(byte)"><CODE>getSocketOption(byte)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="getSocketOption(byte)"><!-- --></A><H3>
getSocketOption</H3>
<PRE>
public int <B>getSocketOption</B>(byte option) throws <A HREF="../../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A>, <A HREF="../../../java/io/IOException.html">IOException</A></PRE>
<DL>
<DD>Get a socket option for the connection.<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>option</CODE> - socket option identifier (KEEPALIVE, LINGER, SNDBUF, RCVBUF, or DELAY)<DT><B>Returns:</B><DD>numeric value for specified option or -1 if the value is not available.<DT><B>Throws:</B><DD><CODE><A HREF="../../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - if the option identifier is not valid<DD><CODE><A HREF="../../../java/io/IOException.html">IOException</A></CODE> - if the connection was closed<DT><B>See Also: </B><DD><A HREF="../../../javax/microedition/io/SocketConnection.html#setSocketOption(byte, int)"><CODE>setSocketOption(byte, int)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="getLocalAddress()"><!-- --></A><H3>
getLocalAddress</H3>
<PRE>
public <A HREF="../../../java/lang/String.html">String</A> <B>getLocalAddress</B>() throws <A HREF="../../../java/io/IOException.html">IOException</A></PRE>
<DL>
<DD>Gets the local address to which the socket is bound. <P>The host address(IP number) that can be used to connect to this end of the socket connection from an external system. Since IP addresses may be dynamically assigned, a remote application will need to be robust in the face of IP number reasssignment.</P> <P> The local hostname (if available) can be accessed from <code> System.getProperty("microedition.hostname")</code> </P><DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>the local address to which the socket is bound.<DT><B>Throws:</B><DD><CODE><A HREF="../../../java/io/IOException.html">IOException</A></CODE> - if the connection was closed.<DT><B>See Also: </B><DD><A HREF="../../../javax/microedition/io/ServerSocketConnection.html"><CODE>ServerSocketConnection</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="getLocalPort()"><!-- --></A><H3>
getLocalPort</H3>
<PRE>
public int <B>getLocalPort</B>() throws <A HREF="../../../java/io/IOException.html">IOException</A></PRE>
<DL>
<DD>Returns the local port to which this socket is bound.<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>the local port number to which this socket is connected.<DT><B>Throws:</B><DD><CODE><A HREF="../../../java/io/IOException.html">IOException</A></CODE> - if the connection was closed.<DT><B>See Also: </B><DD><A HREF="../../../javax/microedition/io/ServerSocketConnection.html"><CODE>ServerSocketConnection</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="getAddress()"><!-- --></A><H3>
getAddress</H3>
<PRE>
public <A HREF="../../../java/lang/String.html">String</A> <B>getAddress</B>() throws <A HREF="../../../java/io/IOException.html">IOException</A></PRE>
<DL>
<DD>Gets the remote address to which the socket is bound. The address can be either the remote host name or the IP address(if available).<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>the remote address to which the socket is bound.<DT><B>Throws:</B><DD><CODE><A HREF="../../../java/io/IOException.html">IOException</A></CODE> - if the connection was closed.</DL>
</DD>
</DL>
<HR>
<A NAME="getPort()"><!-- --></A><H3>
getPort</H3>
<PRE>
public int <B>getPort</B>() throws <A HREF="../../../java/io/IOException.html">IOException</A></PRE>
<DL>
<DD>Returns the remote port to which this socket is bound.<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>the remote port number to which this socket is connected.<DT><B>Throws:</B><DD><CODE><A HREF="../../../java/io/IOException.html">IOException</A></CODE> - if the connection was closed.</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_bottom"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
<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/SocketConnection.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>
<strong>MID Profile</strong></EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../javax/microedition/io/ServerSocketConnection.html"><B>PREV CLASS</B></A>
<A HREF="../../../javax/microedition/io/StreamConnection.html"><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="SocketConnection.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: INNER | <A HREF="#field_summary">FIELD</A> | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: <A HREF="#field_detail">FIELD</A> | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->
<HR>
<font size="-1"><a href="mailto:midp-feedback@risc.sps.mot.com">Submit a comment or suggestion</a> Version 2.0 of MID Profile Specification<br>Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries. Copyright (c) 1993-2002 Sun Microsystems, Inc. 901 San Antonio Road,Palo Alto, California, 94303, U.S.A. All Rights Reserved.</font>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -