mirror of
https://github.com/tursom/TursomServer.git
synced 2024-12-29 14:30:55 +08:00
update WebSocketClient.kt
This commit is contained in:
parent
aeda793a5d
commit
0cc94bf998
@ -1,5 +1,6 @@
|
||||
package cn.tursom.core.ws
|
||||
|
||||
import cn.tursom.core.ShutdownHook
|
||||
import cn.tursom.core.buffer.ByteBuffer
|
||||
import cn.tursom.core.buffer.impl.NettyByteBuffer
|
||||
import io.netty.bootstrap.Bootstrap
|
||||
@ -37,6 +38,12 @@ open class WebSocketClient(
|
||||
var ch: Channel? = null
|
||||
internal set
|
||||
|
||||
init {
|
||||
ShutdownHook.addHook {
|
||||
close()
|
||||
}
|
||||
}
|
||||
|
||||
fun open() {
|
||||
close()
|
||||
val scheme = if (uri.scheme == null) "ws" else uri.scheme
|
||||
|
Loading…
Reference in New Issue
Block a user