Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
maartene committed Jan 22, 2023
1 parent 616302c commit 443cc4d
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 16 deletions.
1 change: 0 additions & 1 deletion Sources/NIOSwiftMUD/Server/SessionHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ struct TextCommand {

final class SessionHandler: ChannelInboundHandler {

//typealias InboundIn = ByteBuffer
typealias InboundIn = SSHChannelData
typealias InboundOut = TextCommand
typealias OutboundOut = SSHChannelData
Expand Down
15 changes: 0 additions & 15 deletions Sources/NIOSwiftMUD/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,33 +7,18 @@ defer {
try! group.syncShutdownGracefully()
}



// We need a host key. We can generate a fixed one or generate one on the fly
//let key = Curve25519.Signing.PrivateKey()
//let keyData = key.rawRepresentation
//let keyDataBase64 = keyData.base64EncodedString()
//print(keyDataBase64)

let fixedKeyBase64b = "UIL9M6Utw/jiupzqq6F8EW4qySxAbgDS+wT7/RIjkJ4="
let fixedKeyData = Data(base64Encoded: fixedKeyBase64b)!
let hostKey = NIOSSHPrivateKey(ed25519Key: try! .init(rawRepresentation: fixedKeyData))

let bootstrap = ServerBootstrap(group: group)
//.serverChannelOption(ChannelOptions.backlog, value: 256)
//.serverChannelOption(ChannelOptions.socketOption(.so_reuseaddr), value: 1)


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

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

0 comments on commit 443cc4d

Please sign in to comment.