Created
October 21, 2018 21:45
-
-
Save ehsun7b/b1b08b6ec85a3e51a56439fa09548927 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 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