refactor: large code cleanup and safety pass
This commit is contained in:
@@ -8,12 +8,10 @@ pub extern "C" fn _start() -> ! {
|
||||
let msg = "Hello from client!";
|
||||
println!("[client] Sent: {}", msg);
|
||||
// TODO: we assume the echo server is task 1 (spawned by omega3)
|
||||
sys_send(1, msg.as_ptr() as usize, msg.len()).unwrap();
|
||||
sys_send(1, msg.as_bytes()).unwrap();
|
||||
|
||||
let out = [0u8; 128];
|
||||
let out_ptr = out.as_ptr() as usize;
|
||||
let max_len = out.len();
|
||||
let (actual_len, _) = sys_recv(out_ptr, max_len).unwrap();
|
||||
let mut out = [0u8; 128];
|
||||
let (actual_len, _) = sys_recv(&mut out).unwrap();
|
||||
println!(
|
||||
"[client] Received: {}",
|
||||
core::str::from_utf8(&out[..actual_len]).unwrap()
|
||||
|
||||
Reference in New Issue
Block a user