mirror of
https://github.com/Mezeporta/Erupe.git
synced 2025-12-13 15:34:38 +01:00
defer closing entranceserver connections
This commit is contained in:
@@ -90,6 +90,7 @@ func (s *Server) acceptClients() {
|
||||
}
|
||||
|
||||
func (s *Server) handleEntranceServerConnection(conn net.Conn) {
|
||||
defer conn.Close()
|
||||
// Client initalizes the connection with a one-time buffer of 8 NULL bytes.
|
||||
nullInit := make([]byte, 8)
|
||||
n, err := io.ReadFull(conn, nullInit)
|
||||
@@ -118,5 +119,4 @@ func (s *Server) handleEntranceServerConnection(conn net.Conn) {
|
||||
cc.SendPacket(data)
|
||||
// Close because we only need to send the response once.
|
||||
// Any further requests from the client will come from a new connection.
|
||||
conn.Close()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user