server: use cmn.ProtocolAndAddress
This commit is contained in:
parent
bb9bb4aa46
commit
6c41ec65bc
|
@ -2,7 +2,6 @@ package server
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"net"
|
"net"
|
||||||
"strings"
|
|
||||||
|
|
||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
|
|
||||||
|
@ -23,8 +22,7 @@ type GRPCServer struct {
|
||||||
|
|
||||||
// NewGRPCServer returns a new gRPC ABCI server
|
// NewGRPCServer returns a new gRPC ABCI server
|
||||||
func NewGRPCServer(protoAddr string, app types.ABCIApplicationServer) cmn.Service {
|
func NewGRPCServer(protoAddr string, app types.ABCIApplicationServer) cmn.Service {
|
||||||
parts := strings.SplitN(protoAddr, "://", 2)
|
proto, addr := cmn.ProtocolAndAddress(protoAddr)
|
||||||
proto, addr := parts[0], parts[1]
|
|
||||||
s := &GRPCServer{
|
s := &GRPCServer{
|
||||||
proto: proto,
|
proto: proto,
|
||||||
addr: addr,
|
addr: addr,
|
||||||
|
|
|
@ -5,7 +5,6 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"net"
|
"net"
|
||||||
"strings"
|
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/tendermint/abci/types"
|
"github.com/tendermint/abci/types"
|
||||||
|
@ -30,8 +29,7 @@ type SocketServer struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewSocketServer(protoAddr string, app types.Application) cmn.Service {
|
func NewSocketServer(protoAddr string, app types.Application) cmn.Service {
|
||||||
parts := strings.SplitN(protoAddr, "://", 2)
|
proto, addr := cmn.ProtocolAndAddress(protoAddr)
|
||||||
proto, addr := parts[0], parts[1]
|
|
||||||
s := &SocketServer{
|
s := &SocketServer{
|
||||||
proto: proto,
|
proto: proto,
|
||||||
addr: addr,
|
addr: addr,
|
||||||
|
|
Loading…
Reference in New Issue