Skip to content

Instantly share code, notes, and snippets.

@ehsun7b
Created October 21, 2018 21:45
Show Gist options
  • Save ehsun7b/b1b08b6ec85a3e51a56439fa09548927 to your computer and use it in GitHub Desktop.
Save ehsun7b/b1b08b6ec85a3e51a56439fa09548927 to your computer and use it in GitHub Desktop.
func sendToClient(ip string, port int, from string, message string) {
client, err := rpc.DialHTTP("tcp", ip+":"+strconv.Itoa(port))
if err != nil {
log.Printf("dialing: %v\n", err.Error())
}
var response int
error := client.Call("Client.Deliver", fmt.Sprintf("%v,%v", from, message), &response)
if error != nil {
log.Printf("calling... %v", error.Error())
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment