Skip to content

Commit 8ba615a

Browse files
authored
Create Tokio example (#24)
Creates an example RTMP server allowing publishing and playback using Tokio and async rust.
1 parent 529e112 commit 8ba615a

12 files changed

+1377
-0
lines changed

Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ members = [
77
"tools/rtmp-log-reader",
88
"examples/mio_rtmp_server",
99
"examples/threaded_rtmp_server",
10+
"examples/tokio_rtmp_server"
1011
]

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ There are currently 2 supported libraries in this project:
1313
## Examples
1414
Several examples have been created that utilize these libraries
1515

16+
* **[tokio_rtmp_server](examples/tokio_rtmp_server)** - This is an example of using the library to create an RTMP server
17+
with async rust and Tokio. Clients can connect, publish video to a stream, and other clients can connect and play the
18+
stream back.
19+
1620
* **[mio_rtmp_server](examples/mio_rtmp_server)** - This is a semi-advanced example of creating a mio application that
1721
can act as both a client and a server. It supports:
1822
* Clients can connect and publish video to a stream.

examples/tokio_rtmp_server/Cargo.toml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[package]
2+
name = "tokio_rtmp_server"
3+
version = "0.1.0"
4+
edition = "2018"
5+
6+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
7+
8+
[dependencies]
9+
tokio = { version = "1.9", features = ["full"]}
10+
futures = { version = "0.3" }
11+
bytes = "1"
12+
rml_rtmp = { path = "../../rtmp" }
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#[derive(PartialEq)]
2+
pub enum ConnectionAction {
3+
None,
4+
Disconnect,
5+
}

0 commit comments

Comments
 (0)