func (this *TelnetCallback) OnConnect(c *gotcp.Conn) bool { addr := c.GetRawConn().RemoteAddr() c.PutExtraData(addr) fmt.Println("OnConnect:", addr) c.AsyncWritePacket(NewTelnetPacket("unknow", []byte("Welcome to this Telnet Server")), 0) return true }
func (this *Callback) OnConnect(c *gotcp.Conn) bool { conn := NewConn(c) c.PutExtraData(conn) return true }
func (this *DasCallback) OnConnect(c *gotcp.Conn) bool { addr := c.GetRawConn().RemoteAddr() c.PutExtraData(addr) fmt.Println("OnConnect:", addr) return true }
func (this *Callback) OnConnect(c *gotcp.Conn) bool { heartbeat := GetConfiguration().GetServerConnCheckInterval() readlimit := GetConfiguration().GetServerReadLimit() writelimit := GetConfiguration().GetServerWriteLimit() config := &ConnConfig{ HeartBeat: uint8(heartbeat), ReadLimit: int64(readlimit), WriteLimit: int64(writelimit), } conn := NewConn(c, config) c.PutExtraData(conn) //NewConns().Add(conn) conn.Do() return true }
func (this *Callback) OnConnect(c *gotcp.Conn) bool { checkinterval := GetConfiguration().GetServerConnCheckInterval() readlimit := GetConfiguration().GetServerReadLimit() writelimit := GetConfiguration().GetServerWriteLimit() config := &ConnConfig{ ConnCheckInterval: uint16(checkinterval), ReadLimit: uint16(readlimit), WriteLimit: uint16(writelimit), } conn := NewConn(c, config) c.PutExtraData(conn) conn.Do() NewConns().Add(conn) return true }