diff options
author | Runxi Yu <me@runxiyu.org> | 2024-12-08 08:52:23 +0800 |
---|---|---|
committer | Runxi Yu <me@runxiyu.org> | 2024-12-08 08:52:23 +0800 |
commit | d201e74fff4e6d82d639d858826bdb4190936c07 (patch) | |
tree | 7e5de8e206bf913fc0bbef5eba81b06fa9c1e06c /client.go | |
parent | Add basic command handling (diff) | |
download | meseircd-d201e74fff4e6d82d639d858826bdb4190936c07.tar.gz meseircd-d201e74fff4e6d82d639d858826bdb4190936c07.tar.zst meseircd-d201e74fff4e6d82d639d858826bdb4190936c07.zip |
Server and self awareness
Diffstat (limited to 'client.go')
-rw-r--r-- | client.go | 25 |
1 files changed, 0 insertions, 25 deletions
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() - } -} |