Yes, the server is not an http/rpc server so using DialHTTP() does not make much sense. Try with net.DialTCP() and use Write() and Read() on the returned TCPConn to send requests and get the responses.
On Tue, Oct 10, 2017 at 11:48 AM Christian LeMoussel <cnh...@gmail.com> wrote: > I'm having trouble translating Python code into GO. > > > s = socks.socksocket() > s.connect((mining_ip_conf, int(port))) # connect to pool > connections.send(s, "getwork", 10) > work_pack = connections.receive(s, 10) > db_block_hash = (work_pack[-1][0]) > diff = int((work_pack[-1][1])) > paddress = (work_pack[-1][2]) > netdiff = int((work_pack[-1][3])) > s.close() > > From what I understand, this code queries an RPC server and retrieves a > JSON RPC response. > > I tried to do this in GO. > > > client, err := rpc.DialHTTP("tcp", fmt.Sprintf("%s:%d", mining_ip, port))if > err != nil { > log.Fatalf("Error in dialing. %s", err)} > var args interface{}var result string > err = client.Call("getwork", args, &result)if err != nil { > log.Fatalf("getwork", err)} > > but I've got an this error. > > 2017/10/10 19:36:49 Error in dialing. dial-http tcp *mining_ip:port*: > unexpected EOF > > Does anyone see anything wrong with this GO code? > > -- > You received this message because you are subscribed to the Google Groups > "golang-nuts" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to golang-nuts+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.