-
 
 import Foundation /// Used for CFRunLoop
 import Darwin

    the server, whereas when we don't call connect the nc command stays active and allows 
    subsequent messages to be sent.
    This issue took a good while to discover. :(
*/
    
//    let connectSuccess = withUnsafePointer(&sockAddress) {
//        connect(sockFd, UnsafePointer($0), socklen_t( sizeofValue(sockAddress)))
//    }
//    guard connectSuccess == 0 else {
//        let errmsg = String.fromCString(strerror(errno))    
//        print("Could not connect! \(errmsg)")
//        return nil
//    }
    
    /// Create a GCD thread that can listen for network events.
    let newResponseSource = DispatchSource.makeReadSource(fileDescriptor: sockFd)
    

    3) Connect the socket (optional).
    4) In a loop/separate thread/event listen for incoming packets.
    */
    
    /// Connect. Since we're using UDP this isn't actually a connection but it does save us
    /// from having to restate the address when we want to use the socket.
    guard case (var sockAddress, let sockFd)? = getSocket(address: address, port: port) else { return nil }
    
    /// Bind the socket to the address
    let bindSuccess = withUnsafePointer(to: &sockAddress) {
