connection.setEndPoint(remoteEndPoint);
//make sure bind packet is the first packet sent to the end point.
if (logger.isFinestEnabled()) {
log(Level.FINEST, "Sending bind packet to " + remoteEndPoint);
}
BindMessage bind = new BindMessage(ioService.getThisAddress(), remoteEndPoint, replyBack);
Data bindData = ioService.toData(bind);
Packet packet = new Packet(bindData, portableContext);
packet.setHeader(Packet.HEADER_BIND);
connection.write(packet);
//now you can send anything...