Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ftr: protocol layer abstraction design #125

Merged
merged 31 commits into from
Mar 4, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
02ad8af
Add: add remoting/net member
mozhou-tech Feb 26, 2023
b3cb54a
Add: add remoting/net member
mozhou-tech Feb 26, 2023
b49eb41
Add: remoting/net/incoming
mozhou-tech Feb 26, 2023
fbe02d6
Add: remoting/net/incoming
mozhou-tech Feb 27, 2023
d48ae45
Add: License
mozhou-tech Feb 27, 2023
8c4cbb4
Add: License
mozhou-tech Feb 27, 2023
27925ea
Merge branch 'main' into main
mozhou-tech Feb 28, 2023
76c2001
Merge branch 'apache:main' into main
mozhou-tech Feb 28, 2023
8bd727d
Merge remote-tracking branch 'origin/main' into main
mozhou-tech Mar 1, 2023
9ddb8d9
Rft: using subpackage to manage registry implementations for avoiding…
mozhou-tech Mar 1, 2023
3e594fa
Ftr: add common/utils subpackage
mozhou-tech Mar 1, 2023
b45d1ba
Ftr: add common/utils subpackage
mozhou-tech Mar 1, 2023
05095fa
Ftr: add common/utils subpackage
mozhou-tech Mar 1, 2023
11139c6
Ftr: add common/utils subpackage
mozhou-tech Mar 1, 2023
d3a048a
Ftr: add common/utils subpackage
mozhou-tech Mar 1, 2023
e777e6b
Ftr: add common/utils subpackage
mozhou-tech Mar 1, 2023
319868c
Ftr: add common/utils subpackage
mozhou-tech Mar 1, 2023
e696071
Ftr: add common/utils subpackage
mozhou-tech Mar 1, 2023
8040708
Merge branch 'apache:main' into main
mozhou-tech Mar 2, 2023
5edc821
Merge remote-tracking branch 'origin/main' into main
mozhou-tech Mar 3, 2023
51077ff
Ftr: host util
mozhou-tech Mar 3, 2023
721f89b
Ftr: host util
mozhou-tech Mar 3, 2023
c305ed7
Ftr: add common base
mozhou-tech Mar 3, 2023
e29a2b7
Ftr: add common base
mozhou-tech Mar 3, 2023
e6c63b0
Ftr: protocol abstraction design
mozhou-tech Mar 3, 2023
f222293
Ftr: protocol abstraction design
mozhou-tech Mar 3, 2023
948dc74
Ftr: protocol abstraction design
mozhou-tech Mar 3, 2023
adc33be
Ftr: protocol abstraction design
mozhou-tech Mar 3, 2023
219076a
Ftr: protocol abstraction design
mozhou-tech Mar 3, 2023
17e89b2
Ftr: protocol abstraction design
mozhou-tech Mar 3, 2023
1d351d1
Ftr: protocol abstraction design
mozhou-tech Mar 3, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add: add remoting/net member
  • Loading branch information
mozhou-tech committed Feb 26, 2023
commit b3cb54a7c7f59aa3ce43ed48b0bcb5709dc158a9
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ dashmap = "5"
lazy_static = "1"
futures = "0.3"
tracing = "0.1"
tracing-subscriber = "0.3.15"
tracing-subscriber = "0.3.15"
4 changes: 2 additions & 2 deletions remoting/net/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ edition = "2021"

[dependencies]
pin-project.workspace = true
tokio = { workspace = true, features = ["net", "time", "sync", "io-util"] }
tokio = { workspace = true, features = ["net", "time", "sync", "io-util","test-util","macros"] }
tokio-stream = { workspace = true, features = ["net"] }
tower.workspace = true
socket2.workspace = true
async-trait.workspace = true
dashmap.workspace = true
lazy_static.workspace = true
futures.workspace = true
tracing.workspace = true
tracing.workspace = true
17 changes: 17 additions & 0 deletions remoting/net/src/conn.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

use std::{
io,
pin::Pin,
Expand Down
16 changes: 16 additions & 0 deletions remoting/net/src/dial.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
use std::io;

use socket2::{Domain, Protocol, Socket, Type};
Expand Down
16 changes: 16 additions & 0 deletions remoting/net/src/incoming.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
use std::{
fmt, io,
task::{Context, Poll},
Expand Down
17 changes: 17 additions & 0 deletions remoting/net/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

pub mod conn;
pub mod dial;
pub mod incoming;
Expand Down
16 changes: 16 additions & 0 deletions remoting/net/src/probe.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
use lazy_static::lazy_static;
use socket2::{Domain, Protocol, Socket, Type};

Expand Down
35 changes: 33 additions & 2 deletions remoting/net/src/tests.rs
Original file line number Diff line number Diff line change
@@ -1,2 +1,33 @@
#[test]
fn test_client() {}
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

use crate::dial::DefaultMakeTransport;
use crate::Address;
use tokio::io::AsyncWriteExt;

// listen by command: `nc -l 8858 -v`
#[tokio::test(flavor = "current_thread")]
async fn test_tcp_bytes_send() {
let transport = DefaultMakeTransport::new();
let mut conn = transport
.make_connection(Address::Ip("127.0.0.1:8858".parse().unwrap()))
.await
.unwrap();
conn.write_all("\n\rhello dubbo-rust\n\r".to_string().as_bytes())
.await
.unwrap();
}