53 |
|
|
54 |
public class SelectorImpl extends AbstractSelector |
public class SelectorImpl extends AbstractSelector |
55 |
{ |
{ |
|
static |
|
|
{ |
|
|
// load the shared library needed for native methods. |
|
|
if (Configuration.INIT_LOAD_LIBRARY) |
|
|
{ |
|
|
System.loadLibrary ("javanio"); |
|
|
} |
|
|
} |
|
56 |
|
|
57 |
private Set keys; |
private Set keys; |
58 |
private Set selected; |
private Set selected; |
132 |
return select (0); |
return select (0); |
133 |
} |
} |
134 |
|
|
|
// A timeout value of 0 means block forever. |
|
|
private static native int implSelect (int[] read, int[] write, |
|
|
int[] except, long timeout) |
|
|
throws IOException; |
|
|
|
|
135 |
private final int[] getFDsAsArray (int ops) |
private final int[] getFDsAsArray (int ops) |
136 |
{ |
{ |
137 |
int[] result; |
int[] result; |
224 |
try |
try |
225 |
{ |
{ |
226 |
begin(); |
begin(); |
227 |
result = implSelect (read, write, except, timeout); |
result = VMSelector.select (read, write, except, timeout); |
228 |
} |
} |
229 |
finally |
finally |
230 |
{ |
{ |