annotate src/main/java/jp/ac/u_ryukyu/treevnc/RequestScreenThread.java @ 331:42fcc9419498

add error message, add lostParent case by fail to connectTo.
author oc
date Tue, 03 Feb 2015 12:31:48 +0900
parents b31903e5b02d
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
206
2b3eb4a9492f MyRfbProto reorganization
oc
parents: 98
diff changeset
1 package jp.ac.u_ryukyu.treevnc;
33
9d3478d11d3b Add the processing of client
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents: 28
diff changeset
2
331
42fcc9419498 add error message, add lostParent case by fail to connectTo.
oc
parents: 207
diff changeset
3 import com.glavsoft.exceptions.TransportException;
16
e654b2e4de64 add TreeTask.java
one
parents: 14
diff changeset
4 import com.glavsoft.rfb.protocol.Protocol;
e654b2e4de64 add TreeTask.java
one
parents: 14
diff changeset
5
11
57ae9fbb1245 add files
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 public class RequestScreenThread implements Runnable {
207
b31903e5b02d rename myRFBProto
oc
parents: 206
diff changeset
7 public TreeRFBProto rfb;
16
e654b2e4de64 add TreeTask.java
one
parents: 14
diff changeset
8 Protocol protocol;
11
57ae9fbb1245 add files
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
9
207
b31903e5b02d rename myRFBProto
oc
parents: 206
diff changeset
10 public RequestScreenThread(TreeRFBProto _rfb) {
11
57ae9fbb1245 add files
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
11 rfb = _rfb;
57ae9fbb1245 add files
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
12 }
57ae9fbb1245 add files
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
13
88
a719aa609e14 add name valuer threads.
oc
parents: 33
diff changeset
14
a719aa609e14 add name valuer threads.
oc
parents: 33
diff changeset
15
a719aa609e14 add name valuer threads.
oc
parents: 33
diff changeset
16 /* (non-Javadoc)
a719aa609e14 add name valuer threads.
oc
parents: 33
diff changeset
17 * @see java.lang.Runnable#run()
a719aa609e14 add name valuer threads.
oc
parents: 33
diff changeset
18 *
a719aa609e14 add name valuer threads.
oc
parents: 33
diff changeset
19 * request full screen update every 3 second.
a719aa609e14 add name valuer threads.
oc
parents: 33
diff changeset
20 * restart send this immediately.
a719aa609e14 add name valuer threads.
oc
parents: 33
diff changeset
21 * nobody call this.
a719aa609e14 add name valuer threads.
oc
parents: 33
diff changeset
22 *
a719aa609e14 add name valuer threads.
oc
parents: 33
diff changeset
23 */
11
57ae9fbb1245 add files
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
24 public void run() {
57ae9fbb1245 add files
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
25 while (true) {
57ae9fbb1245 add files
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
26 try {
88
a719aa609e14 add name valuer threads.
oc
parents: 33
diff changeset
27 synchronized(this) {
a719aa609e14 add name valuer threads.
oc
parents: 33
diff changeset
28 wait();
a719aa609e14 add name valuer threads.
oc
parents: 33
diff changeset
29 }
11
57ae9fbb1245 add files
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
30 Thread.sleep(3000);
331
42fcc9419498 add error message, add lostParent case by fail to connectTo.
oc
parents: 207
diff changeset
31 rfb.writeFramebufferUpdateRequest(0, 0, protocol.getFbWidth(), protocol.getFbHeight(), false);
42fcc9419498 add error message, add lostParent case by fail to connectTo.
oc
parents: 207
diff changeset
32 } catch (InterruptedException e) {
11
57ae9fbb1245 add files
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
33 e.printStackTrace();
331
42fcc9419498 add error message, add lostParent case by fail to connectTo.
oc
parents: 207
diff changeset
34 System.out.println("any thread has interrupted the current thread");
11
57ae9fbb1245 add files
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
35 break;
331
42fcc9419498 add error message, add lostParent case by fail to connectTo.
oc
parents: 207
diff changeset
36 }
42fcc9419498 add error message, add lostParent case by fail to connectTo.
oc
parents: 207
diff changeset
37 }
11
57ae9fbb1245 add files
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
38 }
57ae9fbb1245 add files
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
39
57ae9fbb1245 add files
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
40
88
a719aa609e14 add name valuer threads.
oc
parents: 33
diff changeset
41 /**
a719aa609e14 add name valuer threads.
oc
parents: 33
diff changeset
42 * do nothing.
a719aa609e14 add name valuer threads.
oc
parents: 33
diff changeset
43 */
11
57ae9fbb1245 add files
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
44 public synchronized void reStart() {
57ae9fbb1245 add files
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
45 notify();
57ae9fbb1245 add files
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
46 }
57ae9fbb1245 add files
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
47
57ae9fbb1245 add files
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
48 }