donky.microsoft.aspnet.signalr.client.transport.ClientTransport Maven / Gradle / Ivy
/*
Copyright (c) Microsoft Open Technologies, Inc.
All Rights Reserved
See License.txt in the project root for license information.
*/
package donky.microsoft.aspnet.signalr.client.transport;
import donky.microsoft.aspnet.signalr.client.SignalRFuture;
import donky.microsoft.aspnet.signalr.client.ConnectionBase;
/**
* Represents a client implementation of a network transport
*/
public interface ClientTransport {
/**
* Transport name
*/
public String getName();
/**
* True if the transport supports keepalive messages
*/
public boolean supportKeepAlive();
/**
* Begins the negotiation with the server
*
* @param connection
* Connection information to do the negotiation
* @return A Future for the operation
*/
public SignalRFuture negotiate(ConnectionBase connection);
/**
* Starts the transport
*
* @param connection
* Connection information to start the transport
* @param connectionType
* Connection type
* @param callback
* Callback to invoke when there is new data
* @return A Future for the operation
*/
public SignalRFuture start(ConnectionBase connection, ConnectionType connectionType, DataResultCallback callback);
/**
* Sends data using the transport
*
* @param connection
* Connection information to send data
* @param data
* data to send
* @param callback
* Callback to invoke when data is returned
* @return A Future for the operation
*/
public SignalRFuture send(ConnectionBase connection, String data, DataResultCallback callback);
/**
* Aborts the transport
*
* @param connection
* Connection information to abort
* @return A Future for the operation
*/
public SignalRFuture abort(ConnectionBase connection);
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy