public class SPDYClient extends Object
SPDYClient
allows applications to connect to one or more SPDY servers,
obtaining Session
objects that can be used to send/receive SPDY frames.
SPDYClient
instances are created through a SPDYClient.Factory
:
SPDYClient.Factory factory = new SPDYClient.Factory(); SPDYClient client = factory.newSPDYClient(SPDY.V3);and then used to connect to the server:
FuturePromise<Session> promise = new FuturePromise<>(); client.connect("server.com", null, promise); Session session = promise.get();
Modifier and Type | Class and Description |
---|---|
static class |
SPDYClient.Factory |
Modifier | Constructor and Description |
---|---|
protected |
SPDYClient(short version,
SPDYClient.Factory factory) |
Modifier and Type | Method and Description |
---|---|
Session |
connect(SocketAddress address,
SessionFrameListener listener)
Equivalent to:
|
void |
connect(SocketAddress address,
SessionFrameListener listener,
Promise<Session> promise)
Connects to the given
address , binding the given listener to session events,
and notified the given promise of the connect result. |
SocketAddress |
getBindAddress() |
SPDYClientConnectionFactory |
getConnectionFactory() |
long |
getIdleTimeout() |
int |
getInitialWindowSize() |
boolean |
isExecuteOnFillable() |
protected FlowControlStrategy |
newFlowControlStrategy() |
protected SSLEngine |
newSSLEngine(SslContextFactory sslContextFactory,
SocketChannel channel) |
protected String |
selectProtocol(List<String> serverProtocols) |
void |
setBindAddress(SocketAddress bindAddress) |
void |
setExecuteOnFillable(boolean executeOnFillable) |
void |
setIdleTimeout(long idleTimeout) |
void |
setInitialWindowSize(int initialWindowSize) |
protected SPDYClient(short version, SPDYClient.Factory factory)
public SocketAddress getBindAddress()
setBindAddress(SocketAddress)
public void setBindAddress(SocketAddress bindAddress)
bindAddress
- the address to bind the socket channel togetBindAddress()
public Session connect(SocketAddress address, SessionFrameListener listener) throws ExecutionException, InterruptedException
Future<Session> promise = new FuturePromise<>(); connect(address, listener, promise);
address
- the address to connect tolistener
- the session listener that will be notified of session eventsSession
when connectedExecutionException
InterruptedException
public void connect(SocketAddress address, SessionFrameListener listener, Promise<Session> promise)
address
, binding the given listener
to session events,
and notified the given promise
of the connect result.
If the connect operation is successful, the promise
will be invoked with the Session
object that applications can use to perform SPDY requests.address
- the address to connect tolistener
- the session listener that will be notified of session eventspromise
- the promise notified of connection success/failurepublic long getIdleTimeout()
public void setIdleTimeout(long idleTimeout)
public int getInitialWindowSize()
public void setInitialWindowSize(int initialWindowSize)
public boolean isExecuteOnFillable()
public void setExecuteOnFillable(boolean executeOnFillable)
public SPDYClientConnectionFactory getConnectionFactory()
protected SSLEngine newSSLEngine(SslContextFactory sslContextFactory, SocketChannel channel)
protected FlowControlStrategy newFlowControlStrategy()
Copyright © 1995-2013 Mort Bay Consulting. All Rights Reserved.