![]() Do any additional setup after loading the view. childChannelOption(ChannelOptions.recvAllocator, value: FixedSizeRecvByteBufferAllocator(capacity: 64))Ĭ(PrintEverythingReceivedHandler())Ĭlass ViewController: NSViewController weak var Text1: weak var Text2: NSTextField! You can convert to JavaScript, VBScript, LotusScript, ASP, PHP, JSP, Ruby, Rebol, Lisp, C, Perl, and Python. You only read a maximum of 64 bytes at time. To begin with, select the language from the drop menu. serverChannelOption(ChannelOptions.socketOption(.so_reuseaddr), value: 1) You don't have this in your example but I'd recommend it serverChannelOption(ChannelOptions.backlog, value: 5) I'd recommend to delete this line but I left it Contrary to your comment this doesn't set a Let server = try! ServerBootstrap(group: group) Try client.writeAndFlush(ByteBuffer(string: "hello")).flatMap Let client = try ClientBootstrap(group: group) ![]() Let group = MultiThreadedEventLoopGroup(numberOfThreads: 1) If you're looking to write for Linux or cross platform, then you could use SwiftNIO.Ī pretty much equivalent (but improved in many ways) program can be written easily in SwiftNIO. If you're looking to write for Apple platforms only, you should take a look at amework.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |