Browse Source

add blank client interface

pull/456/head
Ethan Buchman 9 years ago
parent
commit
e8538d606a
2 changed files with 7 additions and 2 deletions
  1. +6
    -1
      client/http_client.go
  2. +1
    -1
      server/handlers.go

+ 6
- 1
client/http_client.go View File

@ -33,6 +33,11 @@ func socketTransport(remote string) *http.Transport {
//------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------
type Client interface {
}
//------------------------------------------------------------------------------------
// JSON rpc takes params as a slice // JSON rpc takes params as a slice
type ClientJSONRPC struct { type ClientJSONRPC struct {
remote string remote string
@ -60,7 +65,7 @@ func (c *ClientJSONRPC) call(method string, params []interface{}, result interfa
} }
requestBytes := wire.JSONBytes(request) requestBytes := wire.JSONBytes(request)
requestBuf := bytes.NewBuffer(requestBytes) requestBuf := bytes.NewBuffer(requestBytes)
log.Info(Fmt("RPC request to %v (%v): %v", c.remote, method, string(requestBytes)))
// log.Info(Fmt("RPC request to %v (%v): %v", c.remote, method, string(requestBytes)))
httpResponse, err := c.client.Post(dummyDomain, "text/json", requestBuf) httpResponse, err := c.client.Post(dummyDomain, "text/json", requestBuf)
if err != nil { if err != nil {
return nil, err return nil, err


+ 1
- 1
server/handlers.go View File

@ -387,7 +387,7 @@ func (wsc *wsConnection) readRoutine() {
// We use `readTimeout` to handle read timeouts. // We use `readTimeout` to handle read timeouts.
_, in, err := wsc.baseConn.ReadMessage() _, in, err := wsc.baseConn.ReadMessage()
if err != nil { if err != nil {
log.Notice("Failed to read from connection", "remote", wsc.remoteAddr)
log.Notice("Failed to read from connection", "remote", wsc.remoteAddr, "err", err.Error())
// an error reading the connection, // an error reading the connection,
// kill the connection // kill the connection
wsc.Stop() wsc.Stop()


Loading…
Cancel
Save