From dd624fd8a279ddf2048253759fc2cb0ec70b746e Mon Sep 17 00:00:00 2001 From: Ludovic Chenut Date: Fri, 8 Mar 2024 11:46:34 +0100 Subject: [PATCH] chore: remove outdated examples --- examples/sctp_both.nim | 25 ------------------------- examples/sctp_client.nim | 14 -------------- examples/sctp_ping.nim | 13 ------------- examples/sctp_pong.nim | 19 ------------------- examples/sctp_server.nim | 13 ------------- 5 files changed, 84 deletions(-) delete mode 100644 examples/sctp_both.nim delete mode 100644 examples/sctp_client.nim delete mode 100644 examples/sctp_ping.nim delete mode 100644 examples/sctp_pong.nim delete mode 100644 examples/sctp_server.nim diff --git a/examples/sctp_both.nim b/examples/sctp_both.nim deleted file mode 100644 index bb861fa..0000000 --- a/examples/sctp_both.nim +++ /dev/null @@ -1,25 +0,0 @@ -import chronos, stew/byteutils -import ../webrtc/sctp as sc - -let sctp = Sctp.new(port = 4242) -proc serv(fut: Future[void]) {.async.} = - sctp.startServer(13) - fut.complete() - let conn = await sctp.listen() - echo "await read()" - let msg = await conn.read() - echo "read() finished" - echo "Receive: ", string.fromBytes(msg) - await conn.close() - sctp.stopServer() - -proc main() {.async.} = - let fut = Future[void]() - asyncSpawn serv(fut) - await fut - let address = TransportAddress(initTAddress("127.0.0.1:4242")) - let conn = await sctp.connect(address, sctpPort = 13) - await conn.write("test".toBytes) - await conn.close() - -waitFor(main()) diff --git a/examples/sctp_client.nim b/examples/sctp_client.nim deleted file mode 100644 index b49b1d8..0000000 --- a/examples/sctp_client.nim +++ /dev/null @@ -1,14 +0,0 @@ -import chronos, stew/byteutils -import ../webrtc/sctp - -proc main() {.async.} = - let - sctp = Sctp.new(port = 4244) - address = TransportAddress(initTAddress("127.0.0.1:4242")) - conn = await sctp.connect(address, sctpPort = 13) - await conn.write("test".toBytes) - let msg = await conn.read() - echo "Client read() finished ; receive: ", string.fromBytes(msg) - await conn.close() - -waitFor(main()) diff --git a/examples/sctp_ping.nim b/examples/sctp_ping.nim deleted file mode 100644 index 0194876..0000000 --- a/examples/sctp_ping.nim +++ /dev/null @@ -1,13 +0,0 @@ -import chronos, stew/byteutils -import ../webrtc/sctp - -proc main() {.async.} = - let sctp = Sctp.new(port = 4244) - let conn = await sctp.connect(initTAddress("127.0.0.1:4242"), sctpPort = 13) - while true: - await conn.write("ping".toBytes) - let msg = await conn.read() - echo "Received: ", string.fromBytes(msg) - await sleepAsync(1.seconds) - -waitFor(main()) diff --git a/examples/sctp_pong.nim b/examples/sctp_pong.nim deleted file mode 100644 index de6a6a0..0000000 --- a/examples/sctp_pong.nim +++ /dev/null @@ -1,19 +0,0 @@ -import chronos, stew/byteutils -import ../webrtc/sctp - -proc sendPong(conn: SctpConnection) {.async.} = - var i = 0 - while true: - let msg = await conn.read() - echo "Received: ", string.fromBytes(msg) - await conn.write(("pong " & $i).toBytes) - i.inc() - -proc main() {.async.} = - let sctp = Sctp.new(port = 4242) - sctp.startServer(13) - while true: - let conn = await sctp.listen() - asyncSpawn conn.sendPong() - -waitFor(main()) diff --git a/examples/sctp_server.nim b/examples/sctp_server.nim deleted file mode 100644 index 429e247..0000000 --- a/examples/sctp_server.nim +++ /dev/null @@ -1,13 +0,0 @@ -import chronos, stew/byteutils -import ../webrtc/sctp - -proc main() {.async.} = - let sctp = Sctp.new(port = 4242) - sctp.startServer(13) - let conn = await sctp.listen() - let msg = await conn.read() - echo "Receive: ", string.fromBytes(msg) - await conn.close() - sctp.stopServer() - -waitFor(main())