Skip to content

Commit 443cc4d

Browse files
committed
cleanup
1 parent 616302c commit 443cc4d

File tree

2 files changed

+0
-16
lines changed

2 files changed

+0
-16
lines changed

Sources/NIOSwiftMUD/Server/SessionHandler.swift

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ struct TextCommand {
1616

1717
final class SessionHandler: ChannelInboundHandler {
1818

19-
//typealias InboundIn = ByteBuffer
2019
typealias InboundIn = SSHChannelData
2120
typealias InboundOut = TextCommand
2221
typealias OutboundOut = SSHChannelData

Sources/NIOSwiftMUD/main.swift

-15
Original file line numberDiff line numberDiff line change
@@ -7,33 +7,18 @@ defer {
77
try! group.syncShutdownGracefully()
88
}
99

10-
11-
12-
// We need a host key. We can generate a fixed one or generate one on the fly
13-
//let key = Curve25519.Signing.PrivateKey()
14-
//let keyData = key.rawRepresentation
15-
//let keyDataBase64 = keyData.base64EncodedString()
16-
//print(keyDataBase64)
17-
1810
let fixedKeyBase64b = "UIL9M6Utw/jiupzqq6F8EW4qySxAbgDS+wT7/RIjkJ4="
1911
let fixedKeyData = Data(base64Encoded: fixedKeyBase64b)!
2012
let hostKey = NIOSSHPrivateKey(ed25519Key: try! .init(rawRepresentation: fixedKeyData))
2113

2214
let bootstrap = ServerBootstrap(group: group)
23-
//.serverChannelOption(ChannelOptions.backlog, value: 256)
24-
//.serverChannelOption(ChannelOptions.socketOption(.so_reuseaddr), value: 1)
25-
2615

2716
// Pipeline
2817
.childChannelInitializer { channel in
2918
channel.pipeline.addHandlers([NIOSSHHandler(role: .server(.init(hostKeys: [hostKey], userAuthDelegate: NoLoginDelegate(), globalRequestDelegate: MUDGlobalRequestDelegate())), allocator: channel.allocator, inboundChildChannelInitializer: sshChildChannelInitializer(_:_:)), ErrorHandler()])
3019
}
3120
.serverChannelOption(ChannelOptions.socket(SocketOptionLevel(SOL_SOCKET), SO_REUSEADDR), value: 1)
3221
.serverChannelOption(ChannelOptions.socket(SocketOptionLevel(IPPROTO_TCP), TCP_NODELAY), value: 1)
33-
// .childChannelOption(ChannelOptions.recvAllocator, value: AdaptiveRecvByteBufferAllocator())
34-
// .childChannelOption(ChannelOptions.socketOption(.so_reuseaddr), value: 1)
35-
// .childChannelOption(ChannelOptions.maxMessagesPerRead, value: 16)
36-
// .childChannelOption(ChannelOptions.recvAllocator, value: AdaptiveRecvByteBufferAllocator())
3722

3823
let host = ProcessInfo.processInfo.environment["NIOSWIFTMUD_HOSTNAME"] ?? "::1"
3924
let port = Int(ProcessInfo.processInfo.environment["NIOSWIFTMUD_PORT"] ?? "2222") ?? 2222

0 commit comments

Comments
 (0)