pipeline.add(new Queue("queue")); // To decouple input and output
pipeline.link("socket", "echo", "queue", "socket");
final byte[] mockData = new byte[] {0x01, 0x02, 0x03};
MockServer server = new MockServer(new Packet[] {new Packet("Server hello") {
{
type = SERVER;
data = mockData;
}
}, new Packet("Client hello") {
{
type = CLIENT;
data = mockData;
}
}, new Packet("Server hello") {
{
type = SERVER;
data = mockData;
}
}, new Packet("Client hello") {
{
type = CLIENT;
data = mockData;
}
}});
server.start();
InetSocketAddress address = server.getAddress();
/*DEBUG*/System.out.println("Address: " + address);
socketWrapper.connect(address);
} catch (Exception e) {