Created
October 21, 2018 21:40
-
-
Save ehsun7b/0049aeedfa921c6c8aff1307eac4b704 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func (s *Server) Send(request string, response *string) error { | |
log.Printf("incoming message: %v", request) | |
parts := strings.Split(request, ",") | |
for username, c := range s.clients { | |
if username != parts[0] { | |
sendToClient(c.Ip, c.Port, parts[0], parts[1]) | |
} | |
} | |
return nil | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment