use of com.tvd12.ezyfoxserver.response.EzyBytesPackage in project ezyfox-server by youngmonkeys.
the class EzyAbstractStreamingApi method createPacket.
private EzyPacket createPacket(byte[] bytes, EzyBytesPackage pack) {
EzySimplePacket packet = new EzySimplePacket();
packet.setTransportType(pack.getTransportType());
packet.setData(bytes);
return packet;
}
use of com.tvd12.ezyfoxserver.response.EzyBytesPackage in project ezyfox-server by youngmonkeys.
the class EzyAbstractStreamingApi method response.
@Override
public void response(EzyBytesPackage pack) throws Exception {
EzyConstant connectionType = getConnectionType();
Collection<EzySession> recipients = pack.getRecipients(connectionType);
if (recipients.isEmpty()) {
return;
}
byte[] bytes = pack.getBytes();
for (EzySession session : recipients) {
session.send(createPacket(bytes, pack));
}
}
use of com.tvd12.ezyfoxserver.response.EzyBytesPackage in project ezyfox-server by youngmonkeys.
the class EzyProxyStreamingApiTest method test.
@Test
public void test() throws Exception {
EzyProxyStreamingApi api = new EzyProxyStreamingApi();
EzyBytesPackage pack = mock(EzyBytesPackage.class);
api.response(pack);
}
Aggregations