mirror of
https://github.com/Polprzewodnikowy/SummerCart64.git
synced 2024-11-21 21:49:15 +01:00
static linux linking
This commit is contained in:
parent
def706884a
commit
8e71d67fbf
3
.github/workflows/build.yml
vendored
3
.github/workflows/build.yml
vendored
@ -62,6 +62,7 @@ jobs:
|
||||
|
||||
- os: ubuntu-latest
|
||||
linux-packages: libudev-dev
|
||||
rust-flags: -C target-feature=+crt-static
|
||||
executable: sc64deployer
|
||||
name: sc64-deployer-linux
|
||||
options: -czf
|
||||
@ -96,6 +97,8 @@ jobs:
|
||||
- name: Build deployer
|
||||
run: cargo b -r
|
||||
working-directory: sw/deployer
|
||||
env:
|
||||
RUSTFLAGS: ${{ matrix.rust-flags }}
|
||||
|
||||
- name: Package executable
|
||||
run: |
|
||||
|
@ -600,16 +600,14 @@ fn handle_server_command(connection: Connection, args: &ServerArgs) -> Result<()
|
||||
};
|
||||
|
||||
sc64::run_server(port, args.address.clone(), |event| match event {
|
||||
ServerEvent::StartedListening(address) => println!(
|
||||
"{}: Started listening on address {}",
|
||||
"[Server]".bold(),
|
||||
address
|
||||
),
|
||||
ServerEvent::NewConnection(peer) => {
|
||||
println!("{}: New connection from {}", "[Server]".bold(), peer);
|
||||
ServerEvent::Listening(address) => {
|
||||
println!("{}: Listening on address [{}]", "[Server]".bold(), address)
|
||||
}
|
||||
ServerEvent::Connection(peer) => {
|
||||
println!("{}: New connection from [{}]", "[Server]".bold(), peer);
|
||||
}
|
||||
ServerEvent::Disconnected(peer) => {
|
||||
println!("{}: Client {} disconnected", "[Server]".bold(), peer);
|
||||
println!("{}: Client disconnected [{}]", "[Server]".bold(), peer);
|
||||
}
|
||||
ServerEvent::Err(error) => {
|
||||
println!(
|
||||
|
@ -382,8 +382,8 @@ pub fn list_local_devices() -> Result<Vec<LocalDevice>, Error> {
|
||||
}
|
||||
|
||||
pub enum ServerEvent {
|
||||
StartedListening(String),
|
||||
NewConnection(String),
|
||||
Listening(String),
|
||||
Connection(String),
|
||||
Disconnected(String),
|
||||
Err(String),
|
||||
}
|
||||
@ -395,9 +395,7 @@ pub fn run_server(
|
||||
) -> Result<(), Error> {
|
||||
let listener = TcpListener::bind(address)?;
|
||||
|
||||
event_callback(ServerEvent::StartedListening(
|
||||
listener.local_addr()?.to_string(),
|
||||
));
|
||||
event_callback(ServerEvent::Listening(listener.local_addr()?.to_string()));
|
||||
|
||||
for stream in listener.incoming() {
|
||||
match stream {
|
||||
@ -429,7 +427,7 @@ fn server_accept_connection(
|
||||
|
||||
let mut buffer = [0u8; 4];
|
||||
|
||||
event_callback(ServerEvent::NewConnection(peer.clone()));
|
||||
event_callback(ServerEvent::Connection(peer.clone()));
|
||||
|
||||
loop {
|
||||
stream.set_nonblocking(true)?;
|
||||
|
Loading…
Reference in New Issue
Block a user