From 37d42b5a9bd762ff2cd3972f95ef11069b7f60d7 Mon Sep 17 00:00:00 2001 From: Noah Metz Date: Sun, 7 Apr 2024 13:38:15 -0600 Subject: [PATCH] Added literal server hello --- server.go | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/server.go b/server.go index 1473918..5fb394e 100644 --- a/server.go +++ b/server.go @@ -164,10 +164,22 @@ func(server *Server) run() { } session.remote = client_addr - server.Log("Got SESSION_CONNECT for client %s at address %s", session.Peer, session.remote) - + server.Log("Got SESSION_CONNECT for session %s at address %s", session.ID, session.remote) // TODO: Send server hello back + server_hello, err := NewSessionData(session, []byte("hello")) + if err != nil { + server.Log("Error generating server hello: %s", err) + continue + } + + _, err = server.connection.WriteToUDP(server_hello, session.remote) + if err != nil { + server.Log("Error sending server hello: %s", err) + continue + } + server.Log("Sent server_hello for %s", session.ID) + case SESSION_CLOSE: session_id := SessionID(buf[COMMAND_LENGTH:COMMAND_LENGTH+ID_LENGTH]) session, exists := server.sessions[session_id]