本文整理了Java中okhttp3.Protocol.get()
方法的一些代码示例,展示了Protocol.get()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Protocol.get()
方法的具体详情如下:
包路径:okhttp3.Protocol
类名称:Protocol
方法名:get
[英]Returns the protocol identified by protocol.
[中]返回由协议标识的协议。
代码示例来源:origin: square/okhttp
protocol = protocolString != null ? Protocol.get(protocolString) : Protocol.HTTP_1_1;
代码示例来源:origin: square/okhttp
handshake = unverifiedHandshake;
protocol = maybeProtocol != null
? Protocol.get(maybeProtocol)
: Protocol.HTTP_1_1;
success = true;
代码示例来源:origin: com.squareup.okhttp3/okhttp
handshake = unverifiedHandshake;
protocol = maybeProtocol != null
? Protocol.get(maybeProtocol)
: Protocol.HTTP_1_1;
success = true;
代码示例来源:origin: com.github.ljun20160606/mockwebserver
private void run() throws Exception {
ServerSocket serverSocket = new ServerSocket(8888);
serverSocket.setReuseAddress(true);
while (true) {
Socket socket = null;
try {
socket = serverSocket.accept();
SSLSocket sslSocket = doSsl(socket);
String protocolString = Platform.get().getSelectedProtocol(sslSocket);
Protocol protocol = protocolString != null ? Protocol.get(protocolString) : null;
if (protocol != Protocol.HTTP_2) {
throw new ProtocolException("Protocol " + protocol + " unsupported");
}
Http2Connection connection = new Http2Connection.Builder(false)
.socket(sslSocket)
.listener(this)
.build();
connection.start();
} catch (IOException e) {
logger.log(Level.INFO, "Http2Server connection failure: " + e);
Util.closeQuietly(socket);
} catch (Exception e) {
logger.log(Level.WARNING, "Http2Server unexpected failure", e);
Util.closeQuietly(socket);
}
}
}
代码示例来源:origin: com.github.ljun20160606/mockwebserver
protocol = protocolString != null ? Protocol.get(protocolString) : Protocol.HTTP_1_1;
代码示例来源:origin: com.github.ljun20160606/okhttp
handshake = unverifiedHandshake;
protocol = maybeProtocol != null
? Protocol.get(maybeProtocol)
: Protocol.HTTP_1_1;
success = true;
代码示例来源:origin: huxq17/SwipeCardsView
handshake = unverifiedHandshake;
protocol = maybeProtocol != null
? Protocol.get(maybeProtocol)
: Protocol.HTTP_1_1;
success = true;
代码示例来源:origin: apache/servicemix-bundles
handshake = unverifiedHandshake;
protocol = maybeProtocol != null
? Protocol.get(maybeProtocol)
: Protocol.HTTP_1_1;
success = true;
代码示例来源:origin: duzechao/OKHttpUtils
handshake = unverifiedHandshake;
protocol = maybeProtocol != null
? Protocol.get(maybeProtocol)
: Protocol.HTTP_1_1;
success = true;
代码示例来源:origin: huxq17/tractor
handshake = unverifiedHandshake;
protocol = maybeProtocol != null
? Protocol.get(maybeProtocol)
: Protocol.HTTP_1_1;
success = true;
内容来源于网络,如有侵权,请联系作者删除!