a network platform to support high concurrent
| Information | |
|---|---|
| Developer | @gyr666 @H00001(frank) @msyyyy(yangweiyao) |
| Language | Golang 1.13.5, gnuc17 |
| Environment | Gnu Linux, OS x. not Windows |
| Version | 0.0.0.1 |
| License | GUN GENERAL PUBLIC LICENSE 3.0 |
| Website | ? |
./config && make && sudo make install
server := core.NewConcurrentNet()
server.OnChannelConnect(func(c core.Channel,p core.Pipeline){
p.AddLast(func(d core.Data) core.Data{
return d
})
}).
SetServerScoketChannel(core.Factory.NewParentChannelInstance()).
Option(&core.BackLog{},1024).
Option(&core.BufferLength{},2020).
Option(&core.NetWorkType{},core.TCP).
AddListen(&core.NetworkInet64{Port:7788}).
Wtype(core.ASYNC)
sc := make(chan os.Signal, 1)
signal.Notify(sc,
syscall.SIGINT,
syscall.SIGTERM,
syscall.SIGQUIT)
go func(){
<-sc
server.Stop()
}()
server.Sync()
server.Join()telnet [::]:1 7788
telent> Ping
Pongpackage core
package buffer implement the buffer alloctor by bitmap and skiplist.
package pipeline implement pipe that when channel create, data I/O, exception, channel close.
package threading implement thread pool by stand threadpool and steal task threadpool