equal
deleted
inserted
replaced
50 |
50 |
51 @Native private static final short FD_OFFSET = 0; // fd offset in pollfd |
51 @Native private static final short FD_OFFSET = 0; // fd offset in pollfd |
52 @Native private static final short EVENT_OFFSET = 4; // events offset in pollfd |
52 @Native private static final short EVENT_OFFSET = 4; // events offset in pollfd |
53 |
53 |
54 static short SIZE_POLLFD = 8; // sizeof pollfd struct |
54 static short SIZE_POLLFD = 8; // sizeof pollfd struct |
55 |
|
56 // events masks |
|
57 @Native static final short POLLIN = AbstractPollArrayWrapper.POLLIN; |
|
58 @Native static final short POLLOUT = AbstractPollArrayWrapper.POLLOUT; |
|
59 @Native static final short POLLERR = AbstractPollArrayWrapper.POLLERR; |
|
60 @Native static final short POLLHUP = AbstractPollArrayWrapper.POLLHUP; |
|
61 @Native static final short POLLNVAL = AbstractPollArrayWrapper.POLLNVAL; |
|
62 @Native static final short POLLREMOVE = AbstractPollArrayWrapper.POLLREMOVE; |
|
63 @Native static final short POLLCONN = 0x0002; |
|
64 |
55 |
65 private int size; // Size of the pollArray |
56 private int size; // Size of the pollArray |
66 |
57 |
67 PollArrayWrapper(int newSize) { |
58 PollArrayWrapper(int newSize) { |
68 int allocationSize = newSize * SIZE_POLLFD; |
59 int allocationSize = newSize * SIZE_POLLFD; |
117 } |
108 } |
118 |
109 |
119 // Adds Windows wakeup socket at a given index. |
110 // Adds Windows wakeup socket at a given index. |
120 void addWakeupSocket(int fdVal, int index) { |
111 void addWakeupSocket(int fdVal, int index) { |
121 putDescriptor(index, fdVal); |
112 putDescriptor(index, fdVal); |
122 putEventOps(index, POLLIN); |
113 putEventOps(index, Net.POLLIN); |
123 } |
114 } |
124 } |
115 } |