public IdentifiedDataSerializable createNew(Integer arg) { return new BindMessage(); } };
@Override public void accept(Packet packet) { assert packet.getPacketType() == Packet.Type.BIND; BindMessage bind = ioService.getSerializationService().toObject(packet); bind((TcpIpConnection) packet.getConn(), bind.getLocalAddress(), bind.getTargetAddress(), bind.shouldReply()); }
@Override public void accept(Packet packet) { assert packet.getPacketType() == Packet.Type.BIND; BindMessage bind = ioService.getSerializationService().toObject(packet); bind((TcpIpConnection) packet.getConn(), bind.getLocalAddress(), bind.getTargetAddress(), bind.shouldReply()); }
public IdentifiedDataSerializable createNew(Integer arg) { return new BindMessage(); } };
void sendBindRequest(TcpIpConnection connection, Address remoteEndPoint, boolean reply) { connection.setEndPoint(remoteEndPoint); ioService.onSuccessfulConnection(remoteEndPoint); //make sure bind packet is the first packet sent to the end point. if (logger.isFinestEnabled()) { logger.finest("Sending bind packet to " + remoteEndPoint); } BindMessage bind = new BindMessage(ioService.getThisAddress(), remoteEndPoint, reply); byte[] bytes = ioService.getSerializationService().toBytes(bind); Packet packet = new Packet(bytes).setPacketType(Packet.Type.BIND); connection.write(packet); //now you can send anything... }
void sendBindRequest(TcpIpConnection connection, Address remoteEndPoint, boolean reply) { connection.setEndPoint(remoteEndPoint); ioService.onSuccessfulConnection(remoteEndPoint); //make sure bind packet is the first packet sent to the end point. if (logger.isFinestEnabled()) { logger.finest("Sending bind packet to " + remoteEndPoint); } BindMessage bind = new BindMessage(ioService.getThisAddress(), remoteEndPoint, reply); byte[] bytes = ioService.getSerializationService().toBytes(bind); Packet packet = new Packet(bytes).setPacketType(Packet.Type.BIND); connection.write(packet); //now you can send anything... }