From 350fa1db3d7ac18b5c69f0031f0388a168e65be1 Mon Sep 17 00:00:00 2001 From: leandro-driguez Date: Sun, 18 Jun 2023 06:58:53 -0400 Subject: [PATCH] fix: delete unnecessary files --- client/client.go | 25 ------------------------- client/client.py | 15 --------------- client/client_test.go | 1 - server/server.go | 30 ------------------------------ server/server.py | 13 ------------- server/server_test.go | 1 - 6 files changed, 85 deletions(-) delete mode 100644 client/client.go delete mode 100644 client/client.py delete mode 100644 client/client_test.go delete mode 100644 server/server.go delete mode 100644 server/server.py delete mode 100644 server/server_test.go diff --git a/client/client.go b/client/client.go deleted file mode 100644 index 1c055d3..0000000 --- a/client/client.go +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "log" - "net" -) - -func main() { - addr := net.UDPAddr{ - IP: net.IPv4(255, 255, 255, 255), - Port: 41234, - } - - conn, err := net.DialUDP("udp4", nil, &addr) - if err != nil { - log.Fatal(err) - } - - buffer := []byte("Hello world!") - _, err = conn.Write(buffer) - if err != nil { - log.Fatal(err) - } - conn.Close() -} diff --git a/client/client.py b/client/client.py deleted file mode 100644 index 2eff7a6..0000000 --- a/client/client.py +++ /dev/null @@ -1,15 +0,0 @@ -import socket - -host = '255.255.255.255' -port = 8888 - -client_socket = socket.socket(socket.AF_INET, \ - socket.SOCK_DGRAM) - -client_socket.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1) - -while True: - msg = input('Enter message to send: ') - client_socket.sendto(msg.encode('utf-8'), (host, port)) - data, addr = client_socket.recvfrom(1024) - print(f"Received: {data}, from: {addr}") diff --git a/client/client_test.go b/client/client_test.go deleted file mode 100644 index 06ab7d0..0000000 --- a/client/client_test.go +++ /dev/null @@ -1 +0,0 @@ -package main diff --git a/server/server.go b/server/server.go deleted file mode 100644 index eb0325f..0000000 --- a/server/server.go +++ /dev/null @@ -1,30 +0,0 @@ -package main - -import ( - "fmt" - "log" - "net" -) - -func main() { - addr, err := net.ResolveUDPAddr("udp4", "0.0.0.0:8888") - if err != nil { - log.Fatal(err) - } - - conn, err := net.ListenUDP("udp4", addr) - if err != nil { - log.Fatal(err) - } - - buffer := make([]byte, 1024) - - for { - n, rAddr, err := conn.ReadFrom(buffer) - if err != nil { - log.Fatal(err) - } - - fmt.Printf("Received %d bytes from %v\n", n, rAddr) - } -} diff --git a/server/server.py b/server/server.py deleted file mode 100644 index ef4e620..0000000 --- a/server/server.py +++ /dev/null @@ -1,13 +0,0 @@ -import socket - -host = '0.0.0.0' -port = 8888 - -server_socket = socket.socket(socket.AF_INET, \ - socket.SOCK_DGRAM) -server_socket.bind((host, port)) - -while True: - data, addr = server_socket.recvfrom(1024) - print(f"Received: {data}, from: {addr}") - server_socket.sendto(b"OK...hello", addr) diff --git a/server/server_test.go b/server/server_test.go deleted file mode 100644 index 06ab7d0..0000000 --- a/server/server_test.go +++ /dev/null @@ -1 +0,0 @@ -package main