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

interface for inbound connection handler manager

This commit is contained in:
v2ray
2016-01-01 23:44:11 +01:00
parent 6344369eb4
commit 3baa1f5bc5
24 changed files with 269 additions and 167 deletions

View File

@@ -6,12 +6,11 @@ import (
"github.com/v2ray/v2ray-core/app"
v2net "github.com/v2ray/v2ray-core/common/net"
"github.com/v2ray/v2ray-core/proxy/common/connhandler"
)
type InboundConnectionHandler struct {
Port v2net.Port
space app.Space
Space app.Space
ConnInput io.Reader
ConnOutput io.Writer
}
@@ -22,7 +21,7 @@ func (this *InboundConnectionHandler) Listen(port v2net.Port) error {
}
func (this *InboundConnectionHandler) Communicate(packet v2net.Packet) error {
ray := this.space.PacketDispatcher().DispatchToOutbound(packet)
ray := this.Space.PacketDispatcher().DispatchToOutbound(packet)
input := ray.InboundInput()
output := ray.InboundOutput()
@@ -48,8 +47,3 @@ func (this *InboundConnectionHandler) Communicate(packet v2net.Packet) error {
writeFinish.Lock()
return nil
}
func (this *InboundConnectionHandler) Create(space app.Space, config interface{}) (connhandler.InboundConnectionHandler, error) {
this.space = space
return this, nil
}