-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Lib] Use WasmEdge as runner and pass clippy test
Signed-off-by: KernelErr <[email protected]>
- Loading branch information
Showing
8 changed files
with
44 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
[build] | ||
target="wasm32-wasi" | ||
target="wasm32-wasi" | ||
|
||
[target.wasm32-wasi] | ||
runner = "wasmedge" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "wasmedge_wasi_socket" | ||
version = "0.3.0" | ||
version = "0.3.1" | ||
authors = [ "Yi <[email protected]>" ] | ||
edition = "2021" | ||
license = "Apache-2.0" | ||
|
@@ -14,8 +14,5 @@ keywords = ["http", "tcp", "socket", "webassembly", "wasmedge"] | |
name = "wasmedge_wasi_socket" | ||
path = "src/lib.rs" | ||
|
||
[features] | ||
std = [] | ||
|
||
[dependencies] | ||
libc = "0.2.3" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,25 @@ | ||
#[cfg(not(feature = "std"))] | ||
use wasmedge_wasi_socket::WasiAddrinfo; | ||
|
||
fn main() { | ||
#[cfg(not(feature = "std"))] | ||
{ | ||
let node = String::from("google.com"); | ||
let service = String::from("http"); | ||
let hints: WasiAddrinfo = WasiAddrinfo::default(); | ||
let mut sockaddr = Vec::new(); | ||
let mut sockbuff = Vec::new(); | ||
let mut ai_canonname = Vec::new(); | ||
let addrinfo = WasiAddrinfo::get_addrinfo( | ||
&node, | ||
&service, | ||
&hints, | ||
10, | ||
&mut sockaddr, | ||
&mut sockbuff, | ||
&mut ai_canonname, | ||
) | ||
.unwrap(); | ||
for i in 0..addrinfo.len() { | ||
if addrinfo[i].ai_addrlen.ne(&0) { | ||
println!("{:?}", sockbuff[i]); | ||
} | ||
let node = String::from("google.com"); | ||
let service = String::from("http"); | ||
let hints: WasiAddrinfo = WasiAddrinfo::default(); | ||
let mut sockaddr = Vec::new(); | ||
let mut sockbuff = Vec::new(); | ||
let mut ai_canonname = Vec::new(); | ||
let addrinfo = WasiAddrinfo::get_addrinfo( | ||
&node, | ||
&service, | ||
&hints, | ||
10, | ||
&mut sockaddr, | ||
&mut sockbuff, | ||
&mut ai_canonname, | ||
) | ||
.unwrap(); | ||
for i in 0..addrinfo.len() { | ||
if addrinfo[i].ai_addrlen.ne(&0) { | ||
println!("{:?}", sockbuff[i]); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters