@@ -69,7 +69,7 @@ public static final UnixSocketChannel open(UnixSocketAddress remote) throws IOEx
6969 public static final UnixSocketChannel create () throws IOException {
7070 UnixSocketChannel channel = new UnixSocketChannel ();
7171 // channel.configureBlocking(true);
72- // channel.socket().setKeepAlive(true);
72+ //channel.socket().setKeepAlive(true);
7373 return channel ;
7474 }
7575
@@ -140,7 +140,7 @@ public boolean connect(UnixSocketAddress remote) throws IOException {
140140 }
141141
142142 public boolean isConnected () {
143- System .out .println ("isConnected: " + state );
143+ // System.out.println("isConnected: " + state);
144144 return state == State .CONNECTED ;
145145 }
146146
@@ -257,16 +257,19 @@ public SocketAddress getLocalAddress() throws IOException {
257257
258258 @ Override
259259 public <T > T getOption (java .net .SocketOption <T > arg0 ) throws IOException {
260+ System .err .println ("getOption unsupported" );
260261 throw new UnsupportedOperationException ("getOption" );
261262 }
262263
263264 @ Override
264265 public Set <java .net .SocketOption <?>> supportedOptions () {
266+ System .err .println ("supportedOptions unsupported" );
265267 throw new UnsupportedOperationException ("supportedOptions" );
266268 }
267269
268270 @ Override
269271 public SocketChannel bind (SocketAddress local ) throws IOException {
272+ System .err .println ("bind unsupported" );
270273 throw new UnsupportedOperationException ("bind" );
271274 }
272275
@@ -292,6 +295,7 @@ public long read(ByteBuffer[] dsts, int offset, int length) throws IOException {
292295
293296 @ Override
294297 public <T > SocketChannel setOption (java .net .SocketOption <T > name , T value ) throws IOException {
298+ System .err .println ("setOption unsupported" );
295299 throw new UnsupportedOperationException ("setOption" );
296300 }
297301
@@ -319,17 +323,18 @@ public long write(ByteBuffer[] srcs, int offset, int length) throws IOException
319323 System .out .println ("remaining: " + remaining );
320324
321325
322- ByteBuffer buffer = ByteBuffer .allocate (remaining );
326+ // ByteBuffer buffer = ByteBuffer.allocate(remaining);
323327
324328 for (index = offset ; index < length ; index ++) {
325- buffer .put (srcs [index ]);
329+ //buffer.put(srcs[index]);
330+ System .err .println ("bulk write: " + index );
331+ //System.err.println(hexDump(srcs[index], ""));
332+ result += write (srcs [index ]);
326333 }
327334
328- buffer .position (0 );
335+ // buffer.position(0);
329336
330- System .out .println ("buffer.remaining: " + buffer .remaining ());
331-
332- result = write (buffer );
337+ //result = write(buffer);
333338 System .out .println ("finally written: " + result );
334339
335340 return result ;
0 commit comments