mirror of
https://github.com/duanhf2012/origin.git
synced 2026-02-04 06:54:45 +08:00
优化Event增加接口支持
This commit is contained in:
@@ -286,8 +286,8 @@ func (slf *HttpRouter) Router(session *HttpSession){
|
||||
session.Done()
|
||||
}
|
||||
|
||||
func (httpService *HttpService) HttpEventHandler(ev *event.Event) {
|
||||
ev.Data.(*HttpSession).Handle()
|
||||
func (httpService *HttpService) HttpEventHandler(ev event.IEvent) {
|
||||
ev.(*event.Event).Data.(*HttpSession).Handle()
|
||||
}
|
||||
|
||||
func (httpService *HttpService) SetHttpRouter(httpRouter IHttpRouter,eventHandler event.IEventHandler) {
|
||||
|
||||
@@ -135,8 +135,8 @@ func (tcpService *TcpService) OnInit() error{
|
||||
return nil
|
||||
}
|
||||
|
||||
func (tcpService *TcpService) TcpEventHandler(ev *event.Event) {
|
||||
pack := ev.Data.(TcpPack)
|
||||
func (tcpService *TcpService) TcpEventHandler(ev event.IEvent) {
|
||||
pack := ev.(*event.Event).Data.(TcpPack)
|
||||
switch pack.Type {
|
||||
case TPT_Connected:
|
||||
tcpService.process.ConnectedRoute(pack.ClientId)
|
||||
|
||||
Reference in New Issue
Block a user