1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-12-27 12:35:21 -05:00

introduce app.Space

This commit is contained in:
v2ray
2015-12-05 22:55:45 +01:00
parent db7d48e48f
commit 15e6e6d80c
11 changed files with 68 additions and 39 deletions

View File

@@ -11,7 +11,7 @@ import (
type InboundConnectionHandler struct {
Port v2net.Port
Dispatcher app.PacketDispatcher
space *app.Space
ConnInput io.Reader
ConnOutput io.Writer
}
@@ -22,7 +22,7 @@ func (this *InboundConnectionHandler) Listen(port v2net.Port) error {
}
func (this *InboundConnectionHandler) Communicate(packet v2net.Packet) error {
ray := this.Dispatcher.DispatchToOutbound(packet)
ray := this.space.PacketDispatcher().DispatchToOutbound(packet)
input := ray.InboundInput()
output := ray.InboundOutput()
@@ -49,7 +49,7 @@ func (this *InboundConnectionHandler) Communicate(packet v2net.Packet) error {
return nil
}
func (this *InboundConnectionHandler) Create(dispatcher app.PacketDispatcher, config interface{}) (connhandler.InboundConnectionHandler, error) {
this.Dispatcher = dispatcher
func (this *InboundConnectionHandler) Create(space *app.Space, config interface{}) (connhandler.InboundConnectionHandler, error) {
this.space = space
return this, nil
}