Simplify the ByteBuffer extension
As per https://github.com/SwiftNIOExtras/swift-nio-irc/issues/3, and after discussion w/ @weissi, just using a String write should be fine and won’t result in allocations. Xlnt.
版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9
京公网安备 11010802032778号
SwiftNIO IRC
SwiftNIO-IRC is a Internet Relay Chat protocol implementation for SwiftNIO.
This module contains just the protocol implementation. We also provide:
To get started with this, pull swift-nio-irc-server - a module to rule them all and in the darkness bind them.
NIOIRC is a SwiftNIO port of the Noze.io miniirc example from 2016.
Importing the module using Swift Package Manager
An example
Package.swiftimporting the necessary modules:Using the SwiftNIO IRC protocol handler
The IRC protocol is implemented as a regular
ChannelHandler, similar toNIOHTTP1. It takes incomingByteBufferdata, parses that, and emitsIRCMessageitems. Same the other way around, the user writesIRCReplyobjects, and the handler renders such intoByteBuffers.To add the IRC handler to a NIO Channel pipeline:
Who
Brought to you by ZeeZide. We like feedback, GitHub stars, cool contract work, presumably any form of praise you can think of.