From d201e74fff4e6d82d639d858826bdb4190936c07 Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Sun, 8 Dec 2024 08:52:23 +0800 Subject: Server and self awareness --- client.go | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 client.go (limited to 'client.go') diff --git a/client.go b/client.go deleted file mode 100644 index 9c73444..0000000 --- a/client.go +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "net" -) - -type Client struct { - conn net.Conn - uid [6]byte -} - -func (client *Client) Send(msg SMsg) { - client.SendRaw(msg.ClientSerialize()) -} - -// Send failures are not returned; broken connections detected and severed on -// the next receive. -func (client *Client) SendRaw(s string) { - _, err := client.conn.Write([]byte(s)) - if err != nil { - // TODO: Should shut down the netFd instead but the stdlib - // doesn't expose a way to do this. - client.conn.Close() - } -} -- cgit v1.2.3