Documentation
¶
Index ¶
- Constants
- type Status
- type TCPMessage
- func (message *TCPMessage) Content() []byte
- func (message *TCPMessage) Drop() error
- func (message *TCPMessage) MarkAsTransmited() error
- func (message *TCPMessage) SetContent(newContent []byte) error
- func (message *TCPMessage) String() string
- func (message *TCPMessage) Transmit() error
- func (message *TCPMessage) WaitForTransmittion() (transmit bool)
- type TransmittionDirection
Constants ¶
View Source
const ( STATUS_PENDING statusRaw = iota STATUS_TRANSMITED STATUS_DROPPED )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TCPMessage ¶
type TCPMessage struct {
// contains filtered or unexported fields
}
func New ¶
func New(transmittionDirection TransmittionDirection, content []byte) *TCPMessage
func (*TCPMessage) Content ¶
func (message *TCPMessage) Content() []byte
func (*TCPMessage) Drop ¶
func (message *TCPMessage) Drop() error
func (*TCPMessage) MarkAsTransmited ¶
func (message *TCPMessage) MarkAsTransmited() error
MarkAsTransmited marks the message as transmited without notifying anobody waiting for transmittion. Use only when nobody is waiting for transmittion. no calls to Transmit/MarkAsTransmited will be possible after this call.
func (*TCPMessage) SetContent ¶
func (message *TCPMessage) SetContent(newContent []byte) error
func (*TCPMessage) String ¶
func (message *TCPMessage) String() string
func (*TCPMessage) Transmit ¶
func (message *TCPMessage) Transmit() error
Transmit marks the packet as transmited and notifies everybody waiting with WaitForTransmittion about the transmittion.
func (*TCPMessage) WaitForTransmittion ¶
func (message *TCPMessage) WaitForTransmittion() (transmit bool)
WaitForTransmittion waits for a signal to transmit. If the signal is true, the message content shall be transmitted. Otherwise, it shall be dropped.
type TransmittionDirection ¶
type TransmittionDirection int
const ( TRANSMITTION_DIRECTION_TO_SERVER TransmittionDirection = iota TRANSMITTION_DIRECTION_TO_CLIENT )
func (TransmittionDirection) String ¶
func (direction TransmittionDirection) String() string
Click to show internal directories.
Click to hide internal directories.