TCP echo server

This commit is contained in:
Alexander Heldt
2025-11-11 20:36:55 +01:00
parent 28b29d3dbf
commit a1971693ef
8 changed files with 191 additions and 50 deletions

View File

@@ -4,6 +4,8 @@ pub type Reason {
/// from `send`
Closed
Overflow
/// Address already in use
Eaddrinuse
/// Cannot assign requested address
@@ -158,6 +160,7 @@ pub type Reason {
pub fn to_string(reason: Reason) -> String {
case reason {
Overflow -> "overflow"
Closed -> "Connection closed (closed)"
Eacces -> "Permission denied (eacces)"
Eaddrinuse -> "Address already in use (eaddrinuse)"