toggle menu
hexagon
3.7.2
jvm
switch theme
search in API
http_client_jetty_ws
/
com.hexagonkt.http.client.jetty.ws
/
JettyWebSocketAdapter
Jetty
Web
Socket
Adapter
@
WebSocket
class
JettyWebSocketAdapter
(
uri
:
URI
,
onConnect
:
WsSession
.
(
)
->
Unit
,
onBinary
:
WsSession
.
(
data
:
ByteArray
)
->
Unit
,
onText
:
WsSession
.
(
text
:
String
)
->
Unit
,
onPing
:
WsSession
.
(
data
:
ByteArray
)
->
Unit
,
onPong
:
WsSession
.
(
data
:
ByteArray
)
->
Unit
,
onClose
:
WsSession
.
(
status
:
Int
,
reason
:
String
)
->
Unit
)
Members
Constructors
Jetty
Web
Socket
Adapter
Link copied to clipboard
constructor
(
uri
:
URI
,
onConnect
:
WsSession
.
(
)
->
Unit
,
onBinary
:
WsSession
.
(
data
:
ByteArray
)
->
Unit
,
onText
:
WsSession
.
(
text
:
String
)
->
Unit
,
onPing
:
WsSession
.
(
data
:
ByteArray
)
->
Unit
,
onPong
:
WsSession
.
(
data
:
ByteArray
)
->
Unit
,
onClose
:
WsSession
.
(
status
:
Int
,
reason
:
String
)
->
Unit
)
Functions
on
Web
Socket
Binary
Link copied to clipboard
@
OnWebSocketMessage
fun
onWebSocketBinary
(
session
:
Session
,
payload
:
ByteBuffer
,
callback
:
Callback
)
on
Web
Socket
Close
Link copied to clipboard
@
OnWebSocketClose
fun
onWebSocketClose
(
session
:
Session
,
statusCode
:
Int
,
reason
:
String
)
on
Web
Socket
Connect
Link copied to clipboard
@
OnWebSocketOpen
fun
onWebSocketConnect
(
connectSession
:
Session
)
on
Web
Socket
Text
Link copied to clipboard
@
OnWebSocketMessage
fun
onWebSocketText
(
session
:
Session
,
message
:
String
)