remove old stuff from example

Signed-off-by: Vasiliy Tolstov <v.tolstov@selfip.ru>
This commit is contained in:
Василий Толстов 2017-06-20 00:56:17 +03:00
parent 661aaab515
commit 7f07cdcd2e

View File

@ -70,9 +70,6 @@ func main() {
log.Fatalf("Error dial. %v", err) log.Fatalf("Error dial. %v", err)
} }
// scfg.Width = cc.Width()
// scfg.Height = cc.Height()
// scfg.PixelFormat = cc.PixelFormat()
go vnc.Serve(context.Background(), ln, scfg) go vnc.Serve(context.Background(), ln, scfg)
defer cc.Close() defer cc.Close()
@ -81,35 +78,19 @@ func main() {
for { for {
select { select {
case msg := <-cchServer: case msg := <-cchServer:
switch msg.Type() { schServer <- msg
default:
schServer <- msg
}
case msg := <-schClient: case msg := <-schClient:
switch msg.Type() { switch msg.Type() {
case vnc.SetEncodingsMsgType: case vnc.SetEncodingsMsgType:
var encTypes []vnc.EncodingType var encTypes []vnc.EncodingType
for _, enc := range scfg.Encodings { for _, senc := range scfg.Encodings {
encTypes = append(encTypes, enc.Type()) for _, cenc := range msg.(*vnc.SetEncodings).Encodings {
} if cenc == senc.Type() {
msg0 := &vnc.SetEncodings{ encTypes = append(encTypes, senc.Type())
Encodings: encTypes,
}
cchClient <- msg0
/*
if scfg.Width != cc.Width() || scfg.Height != cc.Height() {
msg1 := &vnc.FramebufferUpdate{
Rects: []*vnc.Rectangle{&vnc.Rectangle{
Width: cc.Width(),
Height: cc.Height(),
EncType: vnc.EncDesktopSizePseudo,
Enc: &vnc.DesktopSizePseudoEncoding{},
},
},
} }
schServer <- msg1
} }
*/ }
cchClient <- &vnc.SetEncodings{Encodings: encTypes}
default: default:
cchClient <- msg cchClient <- msg
} }