Mercurial > hg > RemoteEditor > REPSessionManager
comparison rep/ServerMainLoop.java @ 391:3b0a5a55e3ee
24
author | one@firefly.cr.ie.u-ryukyu.ac.jp |
---|---|
date | Mon, 10 Nov 2008 22:25:14 +0900 |
parents | aa07134fea32 |
children | 19705f4b8015 |
comparison
equal
deleted
inserted
replaced
390:aa07134fea32 | 391:3b0a5a55e3ee |
---|---|
75 ssc.socket().setReuseAddress(true); //reuse address 必須 | 75 ssc.socket().setReuseAddress(true); //reuse address 必須 |
76 //getAllByNameで取れた全てのアドレスに対してbindする | 76 //getAllByNameで取れた全てのアドレスに対してbindする |
77 try { | 77 try { |
78 ssc.socket().bind(new InetSocketAddress("::",receive_port)); | 78 ssc.socket().bind(new InetSocketAddress("::",receive_port)); |
79 } catch (SocketException e) { | 79 } catch (SocketException e) { |
80 // for some IPv6 imlementation | 80 // for some IPv6 implementation |
81 ssc.socket().bind(new InetSocketAddress(receive_port)); | 81 ssc.socket().bind(new InetSocketAddress(receive_port)); |
82 } | 82 } |
83 ssc.register(selector, SelectionKey.OP_ACCEPT,null); | 83 ssc.register(selector, SelectionKey.OP_ACCEPT,null); |
84 } | 84 } |
85 | 85 |
93 } | 93 } |
94 | 94 |
95 private boolean checkWaitingWrite() throws IOException { | 95 private boolean checkWaitingWrite() throws IOException { |
96 PacketSet p = writeQueue.poll(); | 96 PacketSet p = writeQueue.poll(); |
97 if (p!=null) { | 97 if (p!=null) { |
98 logger.writeLog("writing: "+p.command+" to: " | |
99 +manager.editorList.editorByChannel(p.channel)); | |
98 p.channel.write(p.command); | 100 p.channel.write(p.command); |
99 return true; | 101 return true; |
100 } | 102 } |
101 return false; | 103 return false; |
102 } | 104 } |