mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-10-03 01:06:03 -04:00
24 lines
450 B
Go
24 lines
450 B
Go
|
package app
|
||
|
|
||
|
type Space struct {
|
||
|
packetDispatcher PacketDispatcher
|
||
|
}
|
||
|
|
||
|
func NewSpace() *Space {
|
||
|
return new(Space)
|
||
|
}
|
||
|
|
||
|
func (this *Space) HasPacketDispatcher() bool {
|
||
|
return this.packetDispatcher != nil
|
||
|
}
|
||
|
|
||
|
func (this *Space) PacketDispatcher() PacketDispatcher {
|
||
|
return this.packetDispatcher
|
||
|
}
|
||
|
|
||
|
func (this *Space) Bind(object interface{}) {
|
||
|
if packetDispatcher, ok := object.(PacketDispatcher); ok {
|
||
|
this.packetDispatcher = packetDispatcher
|
||
|
}
|
||
|
}
|