SetShutdown marks the server for shutdown. This method is called when the server receives an "exit" notification from the client. It sets an internal flag that causes the main message loop in Run() to terminate cleanly. Thread Safety: This method is safe to call concurrently, though it's typically
()
| 553 | // This method does not immediately stop the server; it only marks it for shutdown. |
| 554 | // The actual termination occurs when the Run() loop checks the flag. |
| 555 | func (s *Server) SetShutdown() { |
| 556 | s.shutdown = true |
| 557 | } |
| 558 | |
| 559 | // checkRateLimit enforces rate limiting on incoming requests |
| 560 | // Returns true if the request should be allowed, false if rate limited |