From 6c41ec65bcd86489041fb3bf3a7c56cbe9e70dcf Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Wed, 25 Oct 2017 23:04:20 -0400 Subject: [PATCH] server: use cmn.ProtocolAndAddress --- server/grpc_server.go | 4 +--- server/socket_server.go | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/server/grpc_server.go b/server/grpc_server.go index ac3d728ac..077f0e525 100644 --- a/server/grpc_server.go +++ b/server/grpc_server.go @@ -2,7 +2,6 @@ package server import ( "net" - "strings" "google.golang.org/grpc" @@ -23,8 +22,7 @@ type GRPCServer struct { // NewGRPCServer returns a new gRPC ABCI server func NewGRPCServer(protoAddr string, app types.ABCIApplicationServer) cmn.Service { - parts := strings.SplitN(protoAddr, "://", 2) - proto, addr := parts[0], parts[1] + proto, addr := cmn.ProtocolAndAddress(protoAddr) s := &GRPCServer{ proto: proto, addr: addr, diff --git a/server/socket_server.go b/server/socket_server.go index 304a2c7f7..adc7516c6 100644 --- a/server/socket_server.go +++ b/server/socket_server.go @@ -5,7 +5,6 @@ import ( "fmt" "io" "net" - "strings" "sync" "github.com/tendermint/abci/types" @@ -30,8 +29,7 @@ type SocketServer struct { } func NewSocketServer(protoAddr string, app types.Application) cmn.Service { - parts := strings.SplitN(protoAddr, "://", 2) - proto, addr := parts[0], parts[1] + proto, addr := cmn.ProtocolAndAddress(protoAddr) s := &SocketServer{ proto: proto, addr: addr,