These are good topics to review before an interview as of 21 May 2023:
This file contains hidden or 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
| /* | |
| * Lord Of The Rings | |
| * | |
| * $FreeBSD: src/usr.bin/calendar/calendars/calendar.lotr,v 1.2 2003/10/09 00:31:48 grog Exp $ | |
| */ | |
| #ifndef _calendar_lotr_ | |
| #define _calendar_lotr_ | |
| 01/05 Fellowship enters Moria |
This file contains hidden or 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
| use std::net::SocketAddr; | |
| use tokio::io::{AsyncReadExt, AsyncWriteExt}; | |
| use tokio::net::TcpListener; | |
| use tokio::select; | |
| use tokio::sync::broadcast; | |
| #[tokio::main] | |
| async fn main() { | |
| let listener = TcpListener::bind("localhost:7878").await.unwrap(); |
This file contains hidden or 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
| use std::net::{SocketAddrV6, UdpSocket}; | |
| use std::str::{self, FromStr}; | |
| use std::sync::mpsc; | |
| use std::thread; | |
| fn main() { | |
| let multicast_socket = | |
| SocketAddrV6::from_str("[ff02::1%1]:1234").expect("Can't parse multicast address"); | |
| let sender_socket = UdpSocket::bind("[::]:0").expect("Can't bind to local address"); |
This file contains hidden or 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
| use std::net::{ToSocketAddrs, UdpSocket}; | |
| use std::str; | |
| use std::sync::mpsc; | |
| use std::thread; | |
| fn main() { | |
| let multicast_socket = ("ff02::1%en0", 1234) | |
| .to_socket_addrs() | |
| .expect("Can't parse multicast socket address") | |
| .next() |