Added literal server hello

live
noah metz 2024-04-07 13:38:15 -06:00
parent a617d74102
commit 37d42b5a9b
1 changed files with 14 additions and 2 deletions

@ -164,10 +164,22 @@ func(server *Server) run() {
} }
session.remote = client_addr 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 // 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: case SESSION_CLOSE:
session_id := SessionID(buf[COMMAND_LENGTH:COMMAND_LENGTH+ID_LENGTH]) session_id := SessionID(buf[COMMAND_LENGTH:COMMAND_LENGTH+ID_LENGTH])
session, exists := server.sessions[session_id] session, exists := server.sessions[session_id]