接口 XhrTransport
- 所有超级接口:
InfoReceiver
,Transport
public interface XhrTransport extends Transport, InfoReceiver
A SockJSTransport
that uses HTTP requests to simulate a WebSocket interaction. Theconnect
method of the baseTransport
interface is used to receive messages from the server while theexecuteSendRequest(java.net.URI, org.springframework.http.HttpHeaders, org.springframework.web.socket.TextMessage)
method here is used to send messages.- 从以下版本开始:
- 4.1
- 作者:
- Rossen Stoyanchev
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 void
executeSendRequest(URI transportUrl, HttpHeaders headers, TextMessage message)
Execute a request to send the message to the server.boolean
isXhrStreamingDisabled()
AnXhrTransport
supports both the "xhr_streaming" and "xhr" SockJS server transports.从接口继承的方法 org.springframework.web.socket.sockjs.client.InfoReceiver
executeInfoRequest
从接口继承的方法 org.springframework.web.socket.sockjs.client.Transport
connect, getTransportTypes
方法详细资料
isXhrStreamingDisabled
boolean isXhrStreamingDisabled()
AnXhrTransport
supports both the "xhr_streaming" and "xhr" SockJS server transports. From a client perspective there is no implementation difference.By default an
XhrTransport
will be used with "xhr_streaming" first and then with "xhr", if the streaming fails to connect. In some cases it may be useful to suppress streaming so that only "xhr" is used.
executeSendRequest
void executeSendRequest(URI transportUrl, HttpHeaders headers, TextMessage message)
Execute a request to send the message to the server.Note that as of 4.2 this method accepts a
headers
parameter.- 参数:
transportUrl
- the URL for sending messages.message
- the message to send