Mercurial > hg > Members > riono > TreeVNC_ja_comment
comparison src/main/java/jp/ac/u_ryukyu/treevnc/ScreenChangeRequest.java @ 340:fd529c51095f
add port ScreenChangeRequest value.
author | oc |
---|---|
date | Fri, 06 Feb 2015 19:19:14 +0900 |
parents | 4713559f5838 |
children | 2b4251bd5996 |
comparison
equal
deleted
inserted
replaced
339:4713559f5838 | 340:fd529c51095f |
---|---|
19 public class ScreenChangeRequest implements ClientToServerMessage { | 19 public class ScreenChangeRequest implements ClientToServerMessage { |
20 final String bytes; | 20 final String bytes; |
21 private short id; | 21 private short id; |
22 private int frameSizeWidth; | 22 private int frameSizeWidth; |
23 private int frameSizeHeight; | 23 private int frameSizeHeight; |
24 private int port; | |
24 | 25 |
25 public ScreenChangeRequest(String adr, short id, int width, int height) { | 26 public ScreenChangeRequest(String adr, int port, short id, int width, int height) { |
26 this.bytes = adr; | 27 this.bytes = adr; |
28 this.port = port; | |
27 this.id = id; | 29 this.id = id; |
28 this.frameSizeWidth = width; | 30 this.frameSizeWidth = width; |
29 this.frameSizeHeight = height; | 31 this.frameSizeHeight = height; |
30 System.out.println("Client send change screen server request :" + adr); | 32 System.out.println("Client send change screen server request :" + adr); |
31 } | 33 } |
39 out.putShort(id); | 41 out.putShort(id); |
40 out.putInt(bytes.length()); | 42 out.putInt(bytes.length()); |
41 out.put(bytes.getBytes()); | 43 out.put(bytes.getBytes()); |
42 out.putInt(frameSizeWidth); | 44 out.putInt(frameSizeWidth); |
43 out.putInt(frameSizeHeight); | 45 out.putInt(frameSizeHeight); |
46 out.putInt(port); | |
44 writer.write(out.array(), 0, out.position()); | 47 writer.write(out.array(), 0, out.position()); |
45 writer.flush(); | 48 writer.flush(); |
46 } | 49 } |
47 | 50 |
48 @Override | 51 @Override |
49 public String toString() { | 52 public String toString() { |
50 return "Screen change request: [length: " + bytes.length() +", text: ...]" + new String (bytes); | 53 return "Screen change request: [length: " + bytes.length() +", text: ...]" + new String (bytes) + " : " + port; |
51 } | 54 } |
52 } | 55 } |