AutoBuffer( DatagramPacket pack ) { _size = pack.getLength(); _bb = ByteBuffer.wrap(pack.getData(), 0, pack.getLength()).order(ByteOrder.nativeOrder()); _bb.position(0); _read = true; _firstPage = true; _chan = null; _h2o = H2ONode.intern(pack.getAddress(), getPort()); _persist = 0; // No persistance }
AutoBuffer( SocketChannel sock ) throws IOException { _chan = sock; raisePriority(); // Make TCP priority high _bb = bbMake(); _bb.flip(); _read = true; // Reading by default _firstPage = true; // Read Inet from socket, port from the stream, figure out H2ONode _h2o = H2ONode.intern(sock.socket().getInetAddress(), getPort()); _firstPage = true; // Yes, must reset this. assert _h2o != null && _h2o != H2O.SELF; _time_start_ms = System.currentTimeMillis(); _persist = Value.TCP; }
static void tcp_call( final AutoBuffer ab ) { int port = ab.getPort(); long[] snap = ab.getA8(); int idx = CLOUD.nidx(ab._h2o); if( idx >= 0 && idx < SNAPSHOT.length ) SNAPSHOT[idx] = snap; // Ignore out-of-cloud timelines ab.close(); synchronized(TimeLine.class) { TimeLine.class.notify(); } }
AutoBuffer( DatagramChannel sock ) throws IOException { _chan = null; _bb = bbMake(); _read = true; // Reading by default _firstPage = true; // Read a packet; can get H2ONode from 'sad'? Inet4Address addr = null; SocketAddress sad = sock.receive(_bb); if( sad instanceof InetSocketAddress ) { InetAddress address = ((InetSocketAddress) sad).getAddress(); if( address instanceof Inet4Address ) { addr = (Inet4Address) address; } } _size = _bb.position(); _bb.flip(); // Set limit=amount read, and position==0 if( addr == null ) throw new RuntimeException("Unhandled socket type: " + sad); // Read Inet from socket, port from the stream, figure out H2ONode _h2o = H2ONode.intern(addr, getPort()); _firstPage = true; assert _h2o != null; _persist = 0; // No persistance }
public String print16( AutoBuffer ab ) { ab.getPort(); return T.values()[ab.get1()].toString(); } }
@Override public void compute2() { _ab.getPort(); // skip past the port if( _ctrl <= UDP.udp.ack.ordinal() ) UDP.udp.UDPS[_ctrl]._udp.call(_ab).close(); else RPC.remote_exec(_ab); tryComplete(); } /** Exceptional completion path; mostly does printing if the exception was
ab.getPort(); // skip the port bytes if( ctrl == UDP.udp.timeline.ordinal() ) { UDP.udp.timeline._udp.call(ab);