-
Notifications
You must be signed in to change notification settings - Fork 227
Expand file tree
/
Copy pathServerSocketIO.java
More file actions
40 lines (34 loc) · 989 Bytes
/
ServerSocketIO.java
File metadata and controls
40 lines (34 loc) · 989 Bytes
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
/* Copyright (c) 2007-2012 Jython Developers */
package org.python.core.io;
import java.nio.ByteBuffer;
import java.nio.channels.ServerSocketChannel;
import jnr.constants.platform.Errno;
import org.python.core.Py;
/**
* Raw I/O implementation for server sockets.
*
* @author Philip Jenvey
*/
public class ServerSocketIO extends SocketIOBase<ServerSocketChannel> {
/**
* Construct a ServerSocketIO for the given ServerSocketChannel.
*
* @param socketChannel a ServerSocketChannel to wrap
* @param mode a raw io socket mode String
*/
public ServerSocketIO(ServerSocketChannel socketChannel, String mode) {
super(socketChannel, mode);
}
@Override
public int readinto(ByteBuffer buf) {
checkClosed();
checkReadable();
throw Py.IOError(Errno.ENOTCONN);
}
@Override
public int write(ByteBuffer buf) {
checkClosed();
checkWritable();
throw Py.IOError(Errno.EBADF);
}
}