newInstance static method
Implementation
static Transport newInstance(String name, SocketConnect connect) {
if ('websocket' == name) {
return WebSocketTransport(connect);
} else if ('polling' == name) {
if (connect.request.uri.queryParameters.containsKey('j')) {
return JSONPTransport(connect);
} else {
return XHRTransport(connect);
}
} else {
throw UnsupportedError('Unknown transport $name');
}
}