FAQ
I'm building go support for an internal RPC framework that uses package
names in service names like "mycompany.MyServiceName". It seems that when
registering a service using rpc.RegisterName("mycompany.MyServiceName",
MyService), you're not allowed to have periods in the service name:
"MyServiceName" is OK, but "mycompany.MyServiceName" isn't. Does anyone
know an explanation for this?

From src/pkg/net/rpc/server.go:

536 serviceMethod := strings.Split(req.ServiceMethod, ".") 537 if len(serviceMethod) != 2 { 538 err = errors.New("rpc: service/method request ill-formed: " + req.ServiceMethod) 539 return 540 }

--

Search Discussions

  • Kyle Lemons at Dec 8, 2012 at 3:16 am
    The RPC package uses . to split the service from the method (thats the code
    you pasted, actually). You could use a lookalike glyph like the
    center dot<http://www.fileformat.info/info/unicode/char/b7/index.htm>
    or
    something to delimit company and service.

    On Fri, Dec 7, 2012 at 11:39 AM, wrote:

    I'm building go support for an internal RPC framework that uses package
    names in service names like "mycompany.MyServiceName". It seems that when
    registering a service using rpc.RegisterName("mycompany.MyServiceName",
    MyService), you're not allowed to have periods in the service name:
    "MyServiceName" is OK, but "mycompany.MyServiceName" isn't. Does anyone
    know an explanation for this?

    From src/pkg/net/rpc/server.go:

    536 serviceMethod := strings.Split(req.ServiceMethod, ".") 537 if len(serviceMethod) != 2 { 538 err = errors.New("rpc: service/method request ill-formed: " + req.ServiceMethod) 539 return 540 }

    --

    --
  • Russ Cox at Dec 9, 2012 at 8:44 am
    Or use a slash.

    --

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedDec 7, '12 at 9:38p
activeDec 9, '12 at 8:44a
posts3
users3
websitegolang.org

People

Translate

site design / logo © 2021 Grokbase