Giter Site home page Giter Site logo

Comments (5)

davyxu avatar davyxu commented on May 6, 2024

哪个例子?报错详细提示?

运行下tests/Run.sh或者Run.bat会有问题么?

from cellnet.

nosixtools avatar nosixtools commented on May 6, 2024

README.md给的例子

from cellnet.

nosixtools avatar nosixtools commented on May 6, 2024

协议
syntax = "proto3";

package test;

message TestRequest {
string name = 1;
sint32 age = 2;
}

message TestResponse {
string info = 1;
}

代码
func main() {
queue := cellnet.NewEventQueue()
peerIns := peer.NewGenericPeer("tcp.Acceptor", "server", peerAddress, queue)
proc.BindProcessorHandler(peerIns, "tcp.ltv", func(ev cellnet.Event) {
switch ev.Message().(type) {
case *cellnet.SessionAccepted:
fmt.Println("server accepted")
case *cellnet.SessionClosed:
fmt.Println("session closed: ", ev.Session().ID())
case *test.TestRequest:
HandlerTestRequet(ev)
}
})
peerIns.Start()
queue.StartLoop()
}

from cellnet.

davyxu avatar davyxu commented on May 6, 2024

这是你自己改的代码出的问题,不是cellnet自己带的出问题。

import里加入
_ "github.com/davyxu/cellnet/peer/tcp"
_ "github.com/davyxu/cellnet/proc/tcp"

from cellnet.

bss03arg avatar bss03arg commented on May 6, 2024

我也有同样的问题,应该很简单,但是没有解决,可惜了。

panic: peer type not found 'tcp.Acceptor'
try to add code below:
import (
_ "github.com/davyxu/cellnet/peer/tcp"
)

goroutine 1 [running]:
github.com/davyxu/cellnet/peer.NewPeer(0x13abbac, 0xc, 0xc000129ef8, 0x12ef756)
/Users/ccui/go/src/github.com/davyxu/cellnet/peer/peerreg.go:61 +0x62d
github.com/davyxu/cellnet/peer.NewGenericPeer(0x13abbac, 0xc, 0x13a9f33, 0x6, 0x13ac5c6, 0xf, 0x14236c0, 0xc00000e400, 0xc000129f88, 0x10075df)
/Users/ccui/go/src/github.com/davyxu/cellnet/peer/peerreg.go:72 +0x39

from cellnet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.