Mercurial > hg > Members > nobuyasu > tightVNCClient
comparison src/myVncClient/MyVncClient.java @ 35:b3c9be50ef89
add WaitReply
author | Yu Taninari <you@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 08 Jul 2011 20:20:43 +0900 |
parents | 76f5994f2af2 |
children | 1b5d30103205 |
comparison
equal
deleted
inserted
replaced
34:76f5994f2af2 | 35:b3c9be50ef89 |
---|---|
21 // It simply runs the applet inside a newly-created frame. | 21 // It simply runs the applet inside a newly-created frame. |
22 // | 22 // |
23 | 23 |
24 public static void main(String[] argv) { | 24 public static void main(String[] argv) { |
25 MyVncClient v = new MyVncClient(); | 25 MyVncClient v = new MyVncClient(); |
26 v.mainArgs = argv; | 26 v.runClient(argv); |
27 v.inAnApplet = false; | 27 } |
28 v.inSeparateFrame = true; | 28 |
29 | 29 private void runClient(String[] argv) { |
30 v.init(null); | 30 mainArgs = argv; |
31 v.start_threads(); | 31 inAnApplet = false; |
32 v.start(); | 32 inSeparateFrame = true; |
33 | |
34 init(null); | |
35 start_threads(); | |
36 start(); | |
33 } | 37 } |
34 | 38 |
35 // | 39 // |
36 // init() | 40 // init() |
37 // | 41 // |
645 sessionFileName = null; | 649 sessionFileName = null; |
646 recordingActive = false; | 650 recordingActive = false; |
647 } | 651 } |
648 } | 652 } |
649 | 653 |
650 // | 654 /** |
651 // readParameters() - read parameters from the html source or from the | 655 readParameters() - read parameters from the html source or from the |
652 // command line. On the command line, the arguments are just a sequence of | 656 command line. On the command line, the arguments are just a sequence of |
653 // param_name/param_value pairs where the names and values correspond to | 657 param_name/param_value pairs where the names and values correspond to |
654 // those expected in the html applet tag source. | 658 those expected in the html applet tag source. |
655 // | 659 */ |
656 | 660 |
657 void readParameters(Revalue value) { | 661 void readParameters(Revalue value) { |
658 /* | 662 /* |
659 * host = readParameter("HOST", !inAnApplet); | 663 * host = readParameter("HOST", !inAnApplet); |
660 * | 664 * |
666 | 670 |
667 if (value == null) { | 671 if (value == null) { |
668 if (clientSocket == null) { | 672 if (clientSocket == null) { |
669 echo = new echoClient(host); | 673 echo = new echoClient(host); |
670 echo.openport(); | 674 echo.openport(); |
675 | |
671 value = echo.hostn("1"); | 676 value = echo.hostn("1"); |
672 } else { | 677 } else { |
673 echo = new echoClient(); | 678 echo = new echoClient(); |
674 value = echo.Interruption(clientSocket); | 679 value = echo.Interruption(clientSocket); |
675 } | 680 } |
676 } | 681 } |
677 // proxyからの返信で接続先を決定する | 682 // proxyからの返信で接続先を決定する |
678 host = value.responseLine; | 683 host = value.responseLine; |
679 parent = value.parent; | 684 parent = value.parent; |
680 treenum = value.treenum; | 685 treenum = value.treenum; |
681 System.out.println("親は" + parent); | 686 System.out.println("Parent =" + parent); |
682 System.out.println("自分の番号" + treenum); | 687 System.out.println("mynumber =" + treenum); |
683 System.out.println("接続先hostは" + host); | 688 System.out.println("connect host =" + host); |
684 | 689 |
685 if (host == null) { | 690 if (host == null) { |
686 host = getCodeBase().getHost(); | 691 host = getCodeBase().getHost(); |
687 if (host.equals("")) { | 692 if (host.equals("")) { |
688 fatalError("HOST parameter not specified"); | 693 fatalError("HOST parameter not specified"); |