Documentation ¶
Index ¶
Constants ¶
View Source
const ( PROTOCAL_ID protocol.ID = protocol.ID("/cross-clipboard/0.0.1") // data type is the first byte after data size to identify the message type DataTypeDevice DataType = 0xFF // use for device data DataTypeClipboard DataType = 0xFE // use for clipboard data // signal is the first byte after data size to identify the signal type SignalDisconnect Signal = 0xFD // ending exit signal SignalRequestDeviceData Signal = 0xFC // request device data signal )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type StreamHandler ¶
type StreamHandler struct {
// contains filtered or unexported fields
}
StreamHandler struct for stream handler
func NewStreamHandler ¶
func NewStreamHandler( cfg *config.Config, cp *clipboard.ClipboardManager, deviceManager *devicemanager.DeviceManager, logChan chan string, errorChan chan error, pgpDecrypter *crypto.PGPDecrypter, ) *StreamHandler
NewStreamHandler initial new stream handler
func (*StreamHandler) CreateReadData ¶
func (s *StreamHandler) CreateReadData(reader *bufio.Reader, dv *device.Device)
CreateReadData craete a new read streaming for host or peer
func (*StreamHandler) CreateWriteData ¶
func (s *StreamHandler) CreateWriteData()
CreateWriteData handle clipboad channel and write to all peers and host
func (*StreamHandler) HandleStream ¶
func (s *StreamHandler) HandleStream(stream network.Stream)
HandleStream handler when a peer connect this host
func (*StreamHandler) SendSignal ¶
func (s *StreamHandler) SendSignal(dv *device.Device, signal Signal)
SendSignal send signal to device
Click to show internal directories.
Click to hide internal directories.