func NewPluginService(port int) (*PluginService, error) {
	lis, err := net.Listen("tcp", fmt.Sprintf(":%v", port))
	if err != nil {
		return nil, fmt.Errorf("Error open listen server %v", err)
	}

	s := grpc.NewServer()
	go s.Serve(lis)
	p := &PluginService{
		Port:     port,
		listener: lis,
		server:   s,

		activePipes: make(map[string]ActivePipe),
		inputPipes:  make(map[string]InputPipe),
	}
	service := newPluginClientServiceServer(p)
	RegisterPluginReceiveServiceServer(s, service)
	p.service = service
	return p, nil
}
// NewPluginServiceWithPort create PluginService on custom port
NewPluginServiceWithPort create PluginService on custom port
// NewPluginServiceWithPort create PluginService on custom port
func NewPluginService(port int) (*PluginService, error) {
	lis, err := net.Listen("tcp", fmt.Sprintf(":%v", port))
	if err != nil {
		return nil, fmt.Errorf("Error open listen server %v", err)
	}
	s := grpc.NewServer()
	go s.Serve(lis)
	p := &PluginService{
		Port:     port,
		listener: lis,
		server:   s,
		activePipes: make(map[string]ActivePipe),
		inputPipes:  make(map[string]InputPipe),
	}
	service := newPluginClientServiceServer(p)
	RegisterPluginReceiveServiceServer(s, service)
	p.service = service
	return p, nil
}
func NewPluginService ( port int ) ( * PluginService , error ) { lis , err := net . Listen ( " " , fmt . Sprintf ( " " , port ) ) if err != nil { return nil , fmt . Errorf ( " " , err ) } s := grpc . NewServer ( ) go s . Serve ( lis ) p := & PluginService { Port : port , listener : lis , server : s , activePipes : make ( map [ string ] ActivePipe ) , inputPipes : make ( map [ string ] InputPipe ) , } service := newPluginClientServiceServer ( p ) RegisterPluginReceiveServiceServer ( s , service ) p . service = service return p , nil }
NewPluginServiceWithPort create PluginService on custom port
NewPluginServiceWithPort create PluginService on custom port