Documentation ¶
Index ¶
- Constants
- Variables
- type CommandHandler
- type EventPusher
- type PacketHandler
- type Socket
- func (s *Socket) AddCommandHandler(command string, handler CommandHandler)
- func (s *Socket) Close()
- func (s *Socket) CloseError(err error)
- func (s *Socket) ConfigurePing(pingInterval time.Duration, pingTimeout time.Duration)
- func (s *Socket) GetAdapter() adapters.SocketAdapter
- func (s *Socket) GetInterfaceIfManaged() *iface.WaterInterfaceWrapper
- func (s *Socket) HandleInitPacketFragmentation(enabled bool)
- func (s *Socket) IsFeatureEnabled(feature features.Feature) bool
- func (s *Socket) IsLocalFeature(feature features.Feature) bool
- func (s *Socket) LocalAddr() net.Addr
- func (s *Socket) MakeAndSendCommand(parameters commands.CommandParameters) error
- func (s *Socket) RemoteAddr() net.Addr
- func (s *Socket) SendMessage(msgType string, message string) error
- func (s *Socket) Serve()
- func (s *Socket) SetInterface(iface *iface.WaterInterfaceWrapper) error
- func (s *Socket) SetLocalFeature(feature features.Feature, enabled bool)
- func (s *Socket) SetMTU(mtu int)
- func (s *Socket) SetPacketHandler(packetHandler PacketHandler)
- func (s *Socket) Wait()
- func (s *Socket) WaitReady()
- func (s *Socket) WritePacket(data []byte) error
- type SocketConfigurator
Constants ¶
View Source
const UndeterminedProtocolVersion = 0
Variables ¶
View Source
var ErrCommandNotSupported = errors.New("command not supported by peer")
Functions ¶
This section is empty.
Types ¶
type CommandHandler ¶
type CommandHandler func(command *commands.IncomingCommand) error
type EventPusher ¶
type EventPusher = func(evt string)
type PacketHandler ¶
type Socket ¶
type Socket struct { AssignedIP net.IP Metadata map[string]interface{} // contains filtered or unexported fields }
func MakeSocket ¶
func MakeSocket(logger *log.Logger, adapter adapters.SocketAdapter, iface *iface.WaterInterfaceWrapper, ifaceManaged bool, eventPusher EventPusher) *Socket
func (*Socket) AddCommandHandler ¶
func (s *Socket) AddCommandHandler(command string, handler CommandHandler)
func (*Socket) CloseError ¶
func (*Socket) ConfigurePing ¶
func (*Socket) GetAdapter ¶
func (s *Socket) GetAdapter() adapters.SocketAdapter
func (*Socket) GetInterfaceIfManaged ¶
func (s *Socket) GetInterfaceIfManaged() *iface.WaterInterfaceWrapper
func (*Socket) HandleInitPacketFragmentation ¶
func (*Socket) MakeAndSendCommand ¶
func (s *Socket) MakeAndSendCommand(parameters commands.CommandParameters) error
func (*Socket) RemoteAddr ¶
func (*Socket) SetInterface ¶
func (s *Socket) SetInterface(iface *iface.WaterInterfaceWrapper) error
func (*Socket) SetLocalFeature ¶
func (*Socket) SetPacketHandler ¶
func (s *Socket) SetPacketHandler(packetHandler PacketHandler)
func (*Socket) WritePacket ¶
type SocketConfigurator ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.