// Consume recieves vnc-server-bound messages (Client messages) and updates the server part of the proxy
Consume recieves vnc-server-bound messages (Client messages) and updates the server part of the proxy
// Consume recieves vnc - server - bound messages ( Client messages ) and updates the server part of the proxy
func (cc *ClientUpdater) Consume(seg *common.RfbSegment) error {
	switch seg.SegmentType {
	case common.SegmentFullyParsedClientMessage:
		clientMsg := seg.Message.(common.ClientMessage)
		logger.Debugf("ClientUpdater.Consume:(vnc-server-bound) got ClientMessage type=%s", clientMsg.Type())
		switch clientMsg.Type() {
		case common.SetPixelFormatMsgType:
			logger.Debugf("ClientUpdater.Consume: updating pixel format")
			pixFmtMsg := clientMsg.(*server.MsgSetPixelFormat)
			cc.conn.PixelFormat = pixFmtMsg.PF
		}
		err := clientMsg.Write(cc.conn)
		if err != nil {
			logger.Errorf("ClientUpdater.Consume (vnc-server-bound, SegmentFullyParsedClientMessage): problem writing to port: %s", err)
		}
		return err
	}
	return nil
}
func ( cc * ClientUpdater ) Consume ( seg * common . RfbSegment ) error { switch seg . SegmentType { case common . SegmentFullyParsedClientMessage : clientMsg := seg . Message . ( common . ClientMessage ) logger . Debugf ( " " , clientMsg . Type ( ) ) switch clientMsg . Type ( ) { case common . SetPixelFormatMsgType : logger . Debugf ( " " ) pixFmtMsg := clientMsg . ( * server . MsgSetPixelFormat ) cc . conn . PixelFormat = pixFmtMsg . PF } err := clientMsg . Write ( cc . conn ) if err != nil { logger . Errorf ( " " , err ) } return err } return nil }
Consume recieves vnc-server-bound messages (Client messages) and updates the server part of the proxy
Consume recieves vnc - server - bound messages ( Client messages ) and updates the server part of the proxy
//logger.Debugf("ClientUpdater.Consume (vnc-server-bound): got segment type=%s bytes: %v", seg.SegmentType, seg.Bytes) // update pixel format