-
Notifications
You must be signed in to change notification settings - Fork 0
/
ISocketOptions.xml
198 lines (198 loc) · 11.5 KB
/
ISocketOptions.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
<Type Name="ISocketOptions" FullName="Java.Net.ISocketOptions">
<TypeSignature Language="C#" Value="public interface ISocketOptions : Android.Runtime.IJavaObject, IDisposable, Java.Interop.IJavaPeerable" />
<TypeSignature Language="ILAsm" Value=".class public interface auto ansi abstract beforefieldinit ISocketOptions implements class Android.Runtime.IJavaObject, class Java.Interop.IJavaPeerable, class System.IDisposable" />
<TypeSignature Language="DocId" Value="T:Java.Net.ISocketOptions" />
<TypeSignature Language="F#" Value="type ISocketOptions = interface
 interface IJavaObject
 interface IDisposable
 interface IJavaPeerable" />
<AssemblyInfo>
<AssemblyName>Mono.Android</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Interfaces>
<Interface>
<InterfaceName>Android.Runtime.IJavaObject</InterfaceName>
</Interface>
<Interface>
<InterfaceName>Java.Interop.IJavaPeerable</InterfaceName>
</Interface>
<Interface>
<InterfaceName>System.IDisposable</InterfaceName>
</Interface>
</Interfaces>
<Attributes>
<Attribute>
<AttributeName Language="C#">[Android.Runtime.Register("java/net/SocketOptions", "", "Java.Net.ISocketOptionsInvoker")]</AttributeName>
<AttributeName Language="F#">[<Android.Runtime.Register("java/net/SocketOptions", "", "Java.Net.ISocketOptionsInvoker")>]</AttributeName>
</Attribute>
</Attributes>
<Docs since="1">
<summary>Interface of methods to get/set socket options.</summary>
<remarks>
<para>Interface of methods to get/set socket options. This interface is
implemented by: <B>SocketImpl</B> and <B>DatagramSocketImpl</B>.
Subclasses of these should override the methods
of this interface in order to support their own options.</para>
<para>The methods and constants which specify options in this interface are
for implementation only. If you're not subclassing SocketImpl or
DatagramSocketImpl, <B>you won't use these directly.</B> There are
type-safe methods to get/set each of these options in Socket, ServerSocket,
DatagramSocket and MulticastSocket.</para>
<para>Added in 1.1.</para>
<para>
<format type="text/html">
<a href="https://developer.android.com/reference/java/net/SocketOptions" title="Reference documentation">Java documentation for <code>java.net.SocketOptions</code>.</a>
</format>
</para>
<para>
Portions of this page are modifications based on work created and shared by the
<format type="text/html"><a href="https://developers.google.com/terms/site-policies" title="Android Open Source Project">Android Open Source Project</a></format>
and used according to terms described in the
<format type="text/html"><a href="https://creativecommons.org/licenses/by/2.5/" title="Creative Commons 2.5 Attribution License">Creative Commons 2.5 Attribution License.</a></format></para>
</remarks>
<since version="Added in API level 1" />
</Docs>
<Members>
<Member MemberName="GetOption">
<MemberSignature Language="C#" Value="public Java.Lang.Object? GetOption (int optID);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class Java.Lang.Object GetOption(int32 optID) cil managed" />
<MemberSignature Language="DocId" Value="M:Java.Net.ISocketOptions.GetOption(System.Int32)" />
<MemberSignature Language="F#" Value="abstract member GetOption : int -> Java.Lang.Object" Usage="iSocketOptions.GetOption optID" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Mono.Android</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName Language="C#">[Android.Runtime.Register("getOption", "(I)Ljava/lang/Object;", "GetGetOption_IHandler:Java.Net.ISocketOptionsInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]</AttributeName>
<AttributeName Language="F#">[<Android.Runtime.Register("getOption", "(I)Ljava/lang/Object;", "GetGetOption_IHandler:Java.Net.ISocketOptionsInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>Java.Lang.Object</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="optID" Type="System.Int32" />
</Parameters>
<Docs>
<param name="optID">an <c>int</c> identifying the option to fetch</param>
<summary>Fetch the value of an option.</summary>
<returns>the value of the option</returns>
<remarks>
<para>Fetch the value of an option.
Binary options will return java.lang.Boolean.TRUE
if enabled, java.lang.Boolean.FALSE if disabled, e.g.:
<BR></para>
<code lang="text/java">SocketImpl s;
...
Boolean noDelay = (Boolean)(s.getOption(TCP_NODELAY));
if (noDelay.booleanValue()) {
// true if TCP_NODELAY is enabled...
...
}
</code>
<para>For options that take a particular type as a parameter,
getOption(int) will return the parameter's value, else
it will return java.lang.Boolean.FALSE:</para>
<code lang="text/java">Object o = s.getOption(SO_LINGER);
if (o instanceof Integer) {
System.out.print("Linger time is " + ((Integer)o).intValue());
} else {
// the true type of o is java.lang.Boolean.FALSE;
}
</code>
<para>
<format type="text/html">
<a href="https://developer.android.com/reference/java/net/SocketOptions#getOption(int)" title="Reference documentation">Java documentation for <code>java.net.SocketOptions.getOption(int)</code>.</a>
</format>
</para>
<para>
Portions of this page are modifications based on work created and shared by the
<format type="text/html"><a href="https://developers.google.com/terms/site-policies" title="Android Open Source Project">Android Open Source Project</a></format>
and used according to terms described in the
<format type="text/html"><a href="https://creativecommons.org/licenses/by/2.5/" title="Creative Commons 2.5 Attribution License">Creative Commons 2.5 Attribution License.</a></format></para>
</remarks>
<since version="Added in API level 1" />
<exception cref="T:Java.Net.SocketException">if an error occurs reading the option value.
</exception>
</Docs>
</Member>
<Member MemberName="SetOption">
<MemberSignature Language="C#" Value="public void SetOption (int optID, Java.Lang.Object? value);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void SetOption(int32 optID, class Java.Lang.Object value) cil managed" />
<MemberSignature Language="DocId" Value="M:Java.Net.ISocketOptions.SetOption(System.Int32,Java.Lang.Object)" />
<MemberSignature Language="F#" Value="abstract member SetOption : int * Java.Lang.Object -> unit" Usage="iSocketOptions.SetOption (optID, value)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Mono.Android</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName Language="C#">[Android.Runtime.Register("setOption", "(ILjava/lang/Object;)V", "GetSetOption_ILjava_lang_Object_Handler:Java.Net.ISocketOptionsInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]</AttributeName>
<AttributeName Language="F#">[<Android.Runtime.Register("setOption", "(ILjava/lang/Object;)V", "GetSetOption_ILjava_lang_Object_Handler:Java.Net.ISocketOptionsInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="optID" Type="System.Int32" />
<Parameter Name="value" Type="Java.Lang.Object" />
</Parameters>
<Docs>
<param name="optID">identifies the option</param>
<param name="value">the parameter of the socket option</param>
<summary>Enable/disable the option specified by <i>optID</i>.</summary>
<remarks>
<para>Enable/disable the option specified by <i>optID</i>. If the option
is to be enabled, and it takes an option-specific "value", this is
passed in <i>value</i>. The actual type of value is option-specific,
and it is an error to pass something that isn't of the expected type:
<BR></para>
<code lang="text/java">SocketImpl s;
...
s.setOption(SO_LINGER, new Integer(10));
// OK - set SO_LINGER w/ timeout of 10 sec.
s.setOption(SO_LINGER, new Double(10));
// ERROR - expects java.lang.Integer
</code>
<para>If the requested option is binary, it can be set using this method by
a java.lang.Boolean:
<BR></para>
<code lang="text/java">s.setOption(TCP_NODELAY, Boolean.TRUE);
// OK - enables TCP_NODELAY, a binary option
</code>
<para><BR>
Any option can be disabled using this method with a Boolean.FALSE:
<BR></para>
<code lang="text/java">s.setOption(TCP_NODELAY, Boolean.FALSE);
// OK - disables TCP_NODELAY
s.setOption(SO_LINGER, Boolean.FALSE);
// OK - disables SO_LINGER
</code>
<para><BR>
For an option that has a notion of on and off, and requires
a non-boolean parameter, setting its value to anything other than
<i>Boolean.FALSE</i> implicitly enables it.
<BR>
Throws SocketException if the option is unrecognized,
the socket is closed, or some low-level error occurred
<BR></para>
<para>
<format type="text/html">
<a href="https://developer.android.com/reference/java/net/SocketOptions#setOption(int,%20java.lang.Object)" title="Reference documentation">Java documentation for <code>java.net.SocketOptions.setOption(int, java.lang.Object)</code>.</a>
</format>
</para>
<para>
Portions of this page are modifications based on work created and shared by the
<format type="text/html"><a href="https://developers.google.com/terms/site-policies" title="Android Open Source Project">Android Open Source Project</a></format>
and used according to terms described in the
<format type="text/html"><a href="https://creativecommons.org/licenses/by/2.5/" title="Creative Commons 2.5 Attribution License">Creative Commons 2.5 Attribution License.</a></format></para>
</remarks>
<since version="Added in API level 1" />
<exception cref="T:Java.Net.SocketException">if an error occurs setting the option value.
</exception>
</Docs>
</Member>
</Members>
</Type>