MCPcopy Create free account
hub / github.com/ReadyTalk/avian / handleRead

Method handleRead

test/extra/SendServer.java:29–44  ·  view source on GitHub ↗
(SocketChannel channel)

Source from the content-addressed store, hash-verified

27 }
28
29 public void handleRead(SocketChannel channel) throws Exception {
30 int count = -1;
31 while ((count = channel.read(inBuf)) > 0) {
32 System.out.println(myIndex + ": read " + count);
33 }
34 inBuf.flip();
35 fos.write(inBuf.array(), inBuf.arrayOffset()+inBuf.position(), inBuf.remaining());
36 inBuf.position(inBuf.limit());
37 if (count < 0) {
38 System.out.println(myIndex + ": Closing channel");
39 fos.close();
40 channel.close();
41 }
42// dumpByteBuffer(myIndex, inBuf);
43 inBuf.compact();
44 }
45 }
46
47 public void runMainLoop() throws Exception {

Callers 1

runMainLoopMethod · 0.95

Calls 11

readMethod · 0.65
writeMethod · 0.65
closeMethod · 0.65
printlnMethod · 0.45
flipMethod · 0.45
arrayMethod · 0.45
arrayOffsetMethod · 0.45
positionMethod · 0.45
remainingMethod · 0.45
limitMethod · 0.45
compactMethod · 0.45

Tested by

no test coverage detected