mirror of
https://github.com/zhboner/realm.git
synced 2026-11-18 08:17:22 +00:00
remove experimental features
This commit is contained in:
@@ -1,8 +0,0 @@
|
||||
[package]
|
||||
name = "realm_agent"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
@@ -1,8 +0,0 @@
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
#[test]
|
||||
fn it_works() {
|
||||
let result = 2 + 2;
|
||||
assert_eq!(result, 4);
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
[package]
|
||||
name = "realm_ctrl"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
@@ -1,8 +0,0 @@
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
#[test]
|
||||
fn it_works() {
|
||||
let result = 2 + 2;
|
||||
assert_eq!(result, 4);
|
||||
}
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
[build]
|
||||
rustflags = ["--cfg", "tokio_unstable"]
|
||||
@@ -1,8 +0,0 @@
|
||||
[package]
|
||||
name = "realm_x"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
@@ -1,8 +0,0 @@
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
#[test]
|
||||
fn it_works() {
|
||||
let result = 2 + 2;
|
||||
assert_eq!(result, 4);
|
||||
}
|
||||
}
|
||||
@@ -55,41 +55,3 @@ pub async fn run_tcp(endpoint: Endpoint) -> Result<()> {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/// Launch a tcp relay, where tasks are not detached.
|
||||
#[cfg(feature = "x")]
|
||||
pub async fn run_tcp_scoped(endpoint: Endpoint) -> Result<()> {
|
||||
use tokio::task::JoinSet;
|
||||
let Endpoint {
|
||||
laddr,
|
||||
raddr,
|
||||
conn_opts,
|
||||
} = endpoint;
|
||||
|
||||
let raddr = Ref::new(&raddr);
|
||||
let conn_opts = Ref::new(&conn_opts);
|
||||
|
||||
let lis = socket::bind(&laddr).unwrap_or_else(|e| panic!("[tcp]failed to bind {}: {}", &laddr, e));
|
||||
|
||||
let mut tasks = JoinSet::new();
|
||||
|
||||
loop {
|
||||
let (local, addr) = match lis.accept().await {
|
||||
Ok(x) => x,
|
||||
Err(e) => {
|
||||
log::error!("[tcp]failed to accept: {}", e);
|
||||
continue;
|
||||
}
|
||||
};
|
||||
|
||||
// ignore error
|
||||
let _ = local.set_nodelay(true);
|
||||
|
||||
tasks.spawn(async move {
|
||||
match connect_and_relay(local, raddr, conn_opts).await {
|
||||
Ok(..) => log::debug!("[tcp]{} => {}, finish", addr, raddr.as_ref()),
|
||||
Err(e) => log::error!("[tcp]{} => {}, error: {}", addr, raddr.as_ref(), e),
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user