SimpleFileSync/filetransfer.go
2023-05-19 14:43:13 -04:00

26 lines
425 B
Go

package main
import (
"fmt"
"net"
"os"
)
func testClient() {
conn, err := net.Dial("tcp", "localhost:2455")
if err != nil {
fmt.Printf("Error connecting to server: %v", err)
os.Exit(1)
}
_, err = conn.Write(NewSFS(254).ToBytes())
if err != nil {
fmt.Printf("Error sending data: %v", err)
os.Exit(1)
}
err = conn.Close()
if err != nil {
fmt.Printf("Error closing connection: %v", err)
os.Exit(1)
}
}