mirror of
https://github.com/tursom/TursomServer.git
synced 2024-12-29 14:30:55 +08:00
fix http server's web socket unusable bug
This commit is contained in:
parent
a9015bcdb4
commit
06ff1a54f5
@ -29,8 +29,8 @@ class NettyHttpServer(
|
|||||||
var webSocketPath: Iterable<Pair<String, WebSocketHandler<NettyWebSocketContent>>> = listOf(),
|
var webSocketPath: Iterable<Pair<String, WebSocketHandler<NettyWebSocketContent>>> = listOf(),
|
||||||
var readTimeout: Int? = 60,
|
var readTimeout: Int? = 60,
|
||||||
var writeTimeout: Int? = null,
|
var writeTimeout: Int? = null,
|
||||||
decodeType: NettyHttpDecodeType = NettyHttpDecodeType.MULTI_PART,
|
decodeType: NettyHttpDecodeType = if (webSocketPath.iterator().hasNext()) NettyHttpDecodeType.FULL_HTTP else NettyHttpDecodeType.MULTI_PART,
|
||||||
backlog: Int = 1024
|
backlog: Int = 1024,
|
||||||
) : HttpServer {
|
) : HttpServer {
|
||||||
constructor(
|
constructor(
|
||||||
port: Int,
|
port: Int,
|
||||||
@ -39,8 +39,8 @@ class NettyHttpServer(
|
|||||||
webSocketPath: Iterable<Pair<String, WebSocketHandler<NettyWebSocketContent>>> = listOf(),
|
webSocketPath: Iterable<Pair<String, WebSocketHandler<NettyWebSocketContent>>> = listOf(),
|
||||||
readTimeout: Int? = 60,
|
readTimeout: Int? = 60,
|
||||||
writeTimeout: Int? = null,
|
writeTimeout: Int? = null,
|
||||||
decodeType: NettyHttpDecodeType = NettyHttpDecodeType.MULTI_PART,
|
decodeType: NettyHttpDecodeType = if (webSocketPath.iterator().hasNext()) NettyHttpDecodeType.FULL_HTTP else NettyHttpDecodeType.MULTI_PART,
|
||||||
handler: (content: NettyHttpContent) -> Unit
|
handler: (content: NettyHttpContent) -> Unit,
|
||||||
) : this(
|
) : this(
|
||||||
port,
|
port,
|
||||||
object : HttpHandler<NettyHttpContent, NettyExceptionContent> {
|
object : HttpHandler<NettyHttpContent, NettyExceptionContent> {
|
||||||
|
Loading…
Reference in New Issue
Block a user