protected List<Transport> getTransport(RequestBuilder r, Request request) throws IOException {
List<Transport> transports = new ArrayList<Transport>();
if (request.transport().size() == 0) {
transports.add(new WebSocketTransport(r, options, request, functions));
transports.add(new LongPollingTransport(r, options, request, functions));
}
for (Request.TRANSPORT t : request.transport()) {
if (t.equals(Request.TRANSPORT.WEBSOCKET)) {
transports.add(new WebSocketTransport(r, options, request, functions));
} else if (t.equals(Request.TRANSPORT.SSE)) {
transports.add(new SSETransport(r, options, request, functions));
} else if (t.equals(Request.TRANSPORT.LONG_POLLING)) {
transports.add(new LongPollingTransport(r, options, request, functions));
} else if (t.equals(Request.TRANSPORT.STREAMING)) {
transports.add(new StreamTransport(r, options, request, functions));
}
}
return transports;