Skip to content

Instantly share code, notes, and snippets.

@ehsun7b
Created October 21, 2018 21:40
Show Gist options
  • Save ehsun7b/0049aeedfa921c6c8aff1307eac4b704 to your computer and use it in GitHub Desktop.
Save ehsun7b/0049aeedfa921c6c8aff1307eac4b704 to your computer and use it in GitHub Desktop.
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