Mercurial > 510Connectbot
comparison src/com/five_ten_sg/connectbot/transport/TN5250.java @ 32:b086dd794dba tn5250
start tn5250 integration
author | Carl Byington <carl@five-ten-sg.com> |
---|---|
date | Tue, 10 Jun 2014 13:31:30 -0700 |
parents | 139394237973 |
children | 0395ca628303 |
comparison
equal
deleted
inserted
replaced
31:139394237973 | 32:b086dd794dba |
---|---|
54 private static final int DEFAULT_PORT = 23; | 54 private static final int DEFAULT_PORT = 23; |
55 | 55 |
56 private Screen5250 screen52; | 56 private Screen5250 screen52; |
57 private tnvt handler = null; | 57 private tnvt handler = null; |
58 private Socket socket; | 58 private Socket socket; |
59 private int width; | |
60 private int height; | |
61 private boolean connected = false; | 59 private boolean connected = false; |
62 | 60 |
63 static final Pattern hostmask; | 61 static final Pattern hostmask; |
64 static { | 62 static { |
65 hostmask = Pattern.compile("^([0-9a-z.-]+)(:(\\d+))?$", Pattern.CASE_INSENSITIVE); | 63 hostmask = Pattern.compile("^([0-9a-z.-]+)(:(\\d+))?$", Pattern.CASE_INSENSITIVE); |
128 */ | 126 */ |
129 @Override | 127 @Override |
130 public void connect() { | 128 public void connect() { |
131 screen52 = new Screen5250(); | 129 screen52 = new Screen5250(); |
132 handler = new tnvt(screen52, true, false, bridge, manager); | 130 handler = new tnvt(screen52, true, false, bridge, manager); |
131 screen52.setVT(handler); | |
132 screen52.setBuffer(buffer); | |
133 connected = handler.connect(host.getHostname(), host.getPort()); | 133 connected = handler.connect(host.getHostname(), host.getPort()); |
134 if (connected) bridge.onConnected(); | 134 if (connected) bridge.onConnected(); |
135 } | 135 } |
136 | 136 |
137 | 137 |
190 public void flush() throws IOException { | 190 public void flush() throws IOException { |
191 } | 191 } |
192 | 192 |
193 | 193 |
194 /** | 194 /** |
195 * Closes the connection to the terminal. Note that the resulting failure to read | 195 * Closes the connection to the terminal. |
196 * should call {@link TerminalBridge#dispatchDisconnect(boolean)}. !!! | |
197 */ | 196 */ |
198 public void close() { | 197 public void close() { |
199 handler.disconnect(); | 198 handler.disconnect(); |
200 connected = false; | 199 connected = false; |
200 bridge.dispatchDisconnect(false); | |
201 } | 201 } |
202 | 202 |
203 | 203 |
204 /** | 204 /** |
205 * Tells the transport what dimensions the display is currently | 205 * Tells the transport what dimensions the display is currently |