Golang net/rpc/jsonrpc.Dial() and NewClient() functions example
package net/rpc/jsonrpc
Golang net/rpc/jsonrpc.Dial() and NewClient() functions usage example
jsonClient, err := jsonrpc.Dial("tcp", "example.com:8080")
if err != nil {
panic(err)
}
or
ln, err := net.ListenTCP("tcp", tcpIPaddress)
if err != nil {
panic(err)
}
conn, err := ln.Accept()
if err != nil {
continue
}
jsonClient := jsonrpc.NewClient(conn)
References :
Advertisement
Something interesting
Tutorials
+20.9k PHP : Convert(cast) int to double/float
+19.2k Golang : Check whether a network interface is up on your machine
+19.8k Golang : Append content to a file
+8.1k Golang : Variadic function arguments sanity check example
+30.5k Get client IP Address in Go
+18.5k Golang : Set, Get and List environment variables
+6.3k Golang : Extract sub-strings
+14k Golang: Pad right or print ending(suffix) zero or spaces in fmt.Printf example
+8.8k Golang : Take screen shot of browser with JQuery example
+31.6k Golang : Get local IP and MAC address
+6k Golang : Compound interest over time example
+5.2k Golang : Customize scanner.Scanner to treat dash as part of identifier