-#if os(Linux)
-    import Glibc
-#else
-    import Darwin
-#endif
-    
 import OSCCore
-
-// create UDP socket
-let myPort: Int = 57150
-let scPort: Int32 = 57110
-
-let channel = UDPClient(host: "127.0.0.1", port: scPort)
+import NIO
 
 // ---- //
 
+enum SuperColliderExampleError: Error {
+    case decodeOSCPacketFailed
+}
 
 /// simple function that dumps contents of OSCMessage / OSCBundle
 func debugOSCPacket(_ packet: OSCConvertible) {

    }
}

// ---- //

/// assemble a synth


    OSCMessage(address: "/n_set", args: [synthID, "freq", Float32(440.0)])
])

try channel.writeAndFlush(bndl, target: remoteAddr)

// get and print out frequency number from SuperCollider
let getFrqMessage = OSCMessage(address: "/s_get", args: [synthID, "freq"])
try channel.writeAndFlush(getFrqMessage, target: remoteAddr)

// let synth beeping for two secs
sleep(2)

// free synth node
let freeNodeMessage = OSCMessage(address: "/n_free", args: [synthID])
try channel.writeAndFlush(freeNodeMessage, target: remoteAddr)

try channel.close(mode: .all).wait()
