private boolean readHandshake(Decoder in) throws IOException { if (getTransceiver().isConnected()) return true; boolean established = false; HandshakeResponse handshake = HANDSHAKE_READER.read(null, in);
private Protocol handshake(Decoder in, Encoder out, Transceiver connection) throws IOException { if (connection != null && connection.isConnected()) return connection.getRemote(); HandshakeRequest request = (HandshakeRequest)handshakeReader.read(null, in);
private void writeHandshake(Encoder out) throws IOException { if (getTransceiver().isConnected()) return; MD5 localHash = new MD5(); localHash.bytes(local.getMD5()); String remoteName = transceiver.getRemoteName(); MD5 remoteHash = REMOTE_HASHES.get(remoteName); if (remoteHash == null) { // guess remote is local remoteHash = localHash; remote = local; } else { remote = REMOTE_PROTOCOLS.get(remoteHash); } HandshakeRequest handshake = new HandshakeRequest(); handshake.clientHash = localHash; handshake.serverHash = remoteHash; if (sendLocalText) handshake.clientProtocol = local.toString(); RPCContext context = new RPCContext(); context.setHandshakeRequest(handshake); for (RPCPlugin plugin : rpcMetaPlugins) { plugin.clientStartConnect(context); } handshake.meta = context.requestHandshakeMeta(); HANDSHAKE_WRITER.write(handshake, out); }
throws Exception { Transceiver t = getTransceiver(); if (!t.isConnected()) { if (t.isConnected()) {
if ((lm.isOneWay() != rm.isOneWay()) && t.isConnected()) throw new AvroRuntimeException ("Not both one-way messages: "+request.getMessageName()); if (lm.isOneWay() && t.isConnected()) return null; // one-way w/ handshake
List<ByteBuffer> payload = null; List<ByteBuffer> handshake = null; boolean wasConnected = connection != null && connection.isConnected(); try { Protocol remote = handshake(in, out, connection);
private boolean readHandshake(Decoder in) throws IOException { if (getTransceiver().isConnected()) return true; boolean established = false; HandshakeResponse handshake = HANDSHAKE_READER.read(null, in);
private boolean readHandshake(Decoder in) throws IOException { if (getTransceiver().isConnected()) return true; boolean established = false; HandshakeResponse handshake = HANDSHAKE_READER.read(null, in);
private Protocol handshake(Decoder in, Encoder out, Transceiver connection) throws IOException { if (connection != null && connection.isConnected()) return connection.getRemote(); HandshakeRequest request = (HandshakeRequest)handshakeReader.read(null, in);
private void writeHandshake(Encoder out) throws IOException { if (getTransceiver().isConnected()) return; MD5 localHash = new MD5(); localHash.bytes(local.getMD5()); String remoteName = transceiver.getRemoteName(); MD5 remoteHash = REMOTE_HASHES.get(remoteName); remote = REMOTE_PROTOCOLS.get(remoteHash); if (remoteHash == null) { // guess remote is local remoteHash = localHash; remote = local; } HandshakeRequest handshake = new HandshakeRequest(); handshake.clientHash = localHash; handshake.serverHash = remoteHash; if (sendLocalText) handshake.clientProtocol = new Utf8(local.toString()); RPCContext context = new RPCContext(); for (RPCPlugin plugin : rpcMetaPlugins) { plugin.clientStartConnect(context); } handshake.meta = context.requestHandshakeMeta(); HANDSHAKE_WRITER.write(handshake, out); }
private Protocol handshake(Decoder in, Encoder out, Transceiver connection) throws IOException { if (connection != null && connection.isConnected()) return connection.getRemote(); HandshakeRequest request = (HandshakeRequest)handshakeReader.read(null, in);
private void writeHandshake(Encoder out) throws IOException { if (getTransceiver().isConnected()) return; MD5 localHash = new MD5(); localHash.bytes(local.getMD5()); String remoteName = transceiver.getRemoteName(); MD5 remoteHash = REMOTE_HASHES.get(remoteName); if (remoteHash == null) { // guess remote is local remoteHash = localHash; remote = local; } else { remote = REMOTE_PROTOCOLS.get(remoteHash); } HandshakeRequest handshake = new HandshakeRequest(); handshake.clientHash = localHash; handshake.serverHash = remoteHash; if (sendLocalText) handshake.clientProtocol = local.toString(); RPCContext context = new RPCContext(); context.setHandshakeRequest(handshake); for (RPCPlugin plugin : rpcMetaPlugins) { plugin.clientStartConnect(context); } handshake.meta = context.requestHandshakeMeta(); HANDSHAKE_WRITER.write(handshake, out); }
throws Exception { Transceiver t = getTransceiver(); if (!t.isConnected()) { if (t.isConnected()) {
if ((lm.isOneWay() != rm.isOneWay()) && t.isConnected()) throw new AvroRuntimeException ("Not both one-way messages: "+request.getMessageName()); if (lm.isOneWay() && t.isConnected()) return null; // one-way w/ handshake
List<ByteBuffer> payload = null; List<ByteBuffer> handshake = null; boolean wasConnected = connection != null && connection.isConnected(); try { Protocol remote = handshake(in, out, connection);
if (m.isOneWay() && t.isConnected()) { // send one-way message t.writeBuffers(requestBytes); throw new AvroRuntimeException("Not both one-way messages: "+messageName); if (m.isOneWay() && t.isConnected()) return null; // one-way w/ handshake
List<ByteBuffer> payload = null; List<ByteBuffer> handshake = null; boolean wasConnected = connection != null && connection.isConnected(); try { Protocol remote = handshake(in, out, connection);