Precondition failed: BUG DETECTED

'm having trouble getting 2 Raspberry Pi servers and a macOS client all running together.

The macOS client is running 2 URLSession style Web Socket Steams. One to an outside source and one to a local Raspberry Pi - which I'll call RPi-1.

RPi-1 is running an NIOWebSocketServer which talks with the macOS client and a NIOWebSocketClient (called LongmyndService) intending to talk with RPi-2

Another Raspberry Pi, lets call it RPi-2, is running an NIOWebSocketServer which needs to talk with LongmyndService on RPi-1.


Server started and listening on [IPv4]
Establishing connection.
/home/pisat/SatServer/Sources/SatServer/Receiver/LongmyndSevice.swift:59: Precondition failed: BUG DETECTED: wait() must not be called when on an EventLoop.
Calling wait() on any EventLoop can lead to
- deadlocks
- stalling processing of other connections (Channels) that are handled on the EventLoop that wait was called on

Further information:
- current eventLoop: Optional(SelectableEventLoop { selector = Selector { descriptor = 13 }, thread = NIOThread(name = NIO-ELT-0-#0), scheduledTasks = PriorityQueue(count: 1): [ScheduledTask(readyTime: 10695542863481)] })
- event loop associated to future: SelectableEventLoop { selector = Selector { descriptor = 29 }, thread = NIOThread(name = NIO-ELT-1-#0) }
Current stack trace:
0                    0x0000007f93fce998 swift_reportError + 64
1                    0x0000007f9403f454 _swift_stdlib_reportFatalErrorInFile + 124
2                    0x0000007f93d7c718 _assertionFailure(_:_:file:line:flags:) + 296
3    SatServer                          0x000000556eba222c <unavailable> + 2368044

This is the console output from RPi-1. Its server is in main.swift and its client (LongmyndService) is in a class. If I disable LongmyndService, everything works just fine. If I run LongmyndService in indepentant Package, that work too. The console output appears to suggest it is not possible to have more than one SwiftNIO code in a single application. But this can't be right, can it? Please tell me what I'm doing wrong and what I should do.

LongmyndSevice.swift:59 has...

return try bootstrap.connect(host: host, port: port).wait()