java.lang.Object | |
↳ | chan.http.WebSocket |
Web socket request builder and executor.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
WebSocket.Connection | WebSocker connection instance. |
||||||||||
WebSocket.Event | Read data holder. |
||||||||||
WebSocket.EventHandler | Callback for read socket data. |
||||||||||
WebSocket.Result | Connection result holder. |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructor for | |||||||||||
Constructor for | |||||||||||
Constructor for |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Add a | |||||||||||
Add a cookie with given | |||||||||||
Add a cookie string. | |||||||||||
Add a header with given | |||||||||||
Opens a WebSocket connection. | |||||||||||
Sets the timeouts of connection. |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Constructor for WebSocket
.
Parameters | |
---|---|
uri |
Uri :
URI for request. |
holder |
HttpHolder :
HttpHolder instance. May be null. |
preset |
HttpRequest.Preset :
Preset with configuration.
|
Constructor for WebSocket
without preset.
Parameters | |
---|---|
uri |
Uri :
URI for request. |
holder |
HttpHolder :
HttpHolder instance. May be null.
|
Constructor for WebSocket
. In most cases HttpRequest.Preset
can provide it's own
HttpHolder
, so you can use this constructor.
Parameters | |
---|---|
uri |
Uri :
URI for request. |
preset |
HttpRequest.Preset :
Preset with configuration.
|
Add a CookieBuilder
and concatenate it with existing one.
Parameters | |
---|---|
builder |
CookieBuilder :
CookieBuilder instance. |
Returns | |
---|---|
WebSocket |
This builder. |
See also:
Add a cookie with given name
and value
.
Parameters | |
---|---|
name |
String :
Cookie name. |
value |
String :
Cookie value. |
Returns | |
---|---|
WebSocket |
This builder. |
See also:
Add a cookie string.
Parameters | |
---|---|
cookie |
String :
Cookie string. |
Returns | |
---|---|
WebSocket |
This builder. |
See also:
Add a header with given name
and value
.
Parameters | |
---|---|
name |
String :
Header name. |
value |
String :
Header value. |
Returns | |
---|---|
WebSocket |
This builder. |
Opens a WebSocket connection.
Parameters | |
---|---|
handler |
WebSocket.EventHandler :
Event handler for incoming data. |
Returns | |
---|---|
WebSocket.Connection |
Connection instance. |
Throws | |
---|---|
HttpException |
if HTTP exception occurred. |
Sets the timeouts of connection.
Parameters | |
---|---|
connectTimeout |
int :
TCP handshake timeout in milliseconds. |
readTimeout |
int :
Max delay in milliseconds between reading data. |
Returns | |
---|---|
WebSocket |
This builder. |