blob: cd5648e25d6f79f1eaace2e33f5b8dc07463d34b [file] [log] [blame]
Meki Cherkaoui4910fbc2012-04-22 15:51:46 -07001// @author: ucla-cs
Jeff Thompson745026e2012-10-13 12:49:20 -07002// See COPYING for copyright and distribution information.
Meki Cherkaoui9eaf4142012-04-22 15:32:12 -07003
Meki Cherkaouif441d3a2012-04-22 15:17:52 -07004
5import java.applet.*;
6import javax.swing.*;
7import netscape.javascript.*;
8
Meki Cherkaoui09847972012-06-06 03:26:30 -07009import java.lang.reflect.InvocationTargetException;
Meki Cherkaouif441d3a2012-04-22 15:17:52 -070010import java.net.*;
Meki Cherkaoui09847972012-06-06 03:26:30 -070011import java.nio.ByteBuffer;
12import java.nio.channels.ClosedChannelException;
13import java.nio.channels.DatagramChannel;
14import java.nio.channels.SelectionKey;
15import java.nio.channels.Selector;
16import java.nio.channels.ServerSocketChannel;
17import java.nio.channels.SocketChannel;
Meki Cherkaouif441d3a2012-04-22 15:17:52 -070018import java.security.AccessController;
19import java.security.PrivilegedAction;
Meki Cherkaoui09847972012-06-06 03:26:30 -070020import java.util.Hashtable;
21import java.util.Iterator;
22import java.util.Set;
23import java.util.Timer;
Meki Cherkaouiabb973b2012-05-09 14:25:57 -070024import java.util.concurrent.ConcurrentHashMap;
Meki Cherkaoui09847972012-06-06 03:26:30 -070025import java.util.concurrent.atomic.AtomicInteger;
Meki Cherkaouif441d3a2012-04-22 15:17:52 -070026import java.io.*;
27
Meki Cherkaoui09847972012-06-06 03:26:30 -070028
29
Meki Cherkaouif441d3a2012-04-22 15:17:52 -070030public class JavaSocketBridge extends JApplet {
31
Meki Cherkaoui09847972012-06-06 03:26:30 -070032 static String protocol = "TCP";
33
34 static volatile Hashtable<String, SocketChannel> connections = new Hashtable<String, SocketChannel>();
35
36
37
38 volatile String result = "";
39
40 //static ConcurrentHashMap hm = null;
41 static boolean isBrowser = true;
42
43
44
45
46 private final static int PACKETSIZE = 2000 ;
Meki Cherkaouif441d3a2012-04-22 15:17:52 -070047 // Instance variables
Meki Cherkaouiabb973b2012-05-09 14:25:57 -070048 static JSObject browser = null; // The browser
Meki Cherkaouif441d3a2012-04-22 15:17:52 -070049
Meki Cherkaoui09847972012-06-06 03:26:30 -070050 protected Selector _ncReadSelector = null;
51 protected Selector _ncWriteSelector = null;
Meki Cherkaouif441d3a2012-04-22 15:17:52 -070052
Meki Cherkaoui09847972012-06-06 03:26:30 -070053
54 // Initialize automatically called by browser
Meki Cherkaouif441d3a2012-04-22 15:17:52 -070055 public void init(){
Meki Cherkaoui09847972012-06-06 03:26:30 -070056
57 try{
58 browser = JSObject.getWindow(this);
59 }
60 catch(Exception e){
61 error( "ERROR IN INIT" + e.toString());
62 }
Meki Cherkaouif441d3a2012-04-22 15:17:52 -070063 }
64
Meki Cherkaoui09847972012-06-06 03:26:30 -070065 //start automatically called by browser
66 public void start(){
67 try {
68 browser.call("java_socket_bridge_ready", null);
69 } catch (Exception e) {
70 // TODO Auto-generated catch block
71 error("ERROR IN START" +e.toString());
72 }
73
74 }
75
76 public String getOLD(final String h, final int p, final String interest, final int timeout){
Meki Cherkaouif441d3a2012-04-22 15:17:52 -070077 return AccessController.doPrivileged(
78 new PrivilegedAction<String>() {
79 public String run() {
80
Meki Cherkaoui09847972012-06-06 03:26:30 -070081 Socket sock=null;
82 OutputStream out=null;
83 InputStream in=null;
Meki Cherkaouif441d3a2012-04-22 15:17:52 -070084
Meki Cherkaoui09847972012-06-06 03:26:30 -070085 try{
Meki Cherkaouif441d3a2012-04-22 15:17:52 -070086
Meki Cherkaouiabb973b2012-05-09 14:25:57 -070087
Meki Cherkaoui09847972012-06-06 03:26:30 -070088 sock=new Socket(h,p);
Meki Cherkaouif441d3a2012-04-22 15:17:52 -070089
Meki Cherkaouif441d3a2012-04-22 15:17:52 -070090
Meki Cherkaoui09847972012-06-06 03:26:30 -070091 String word= interest;
Meki Cherkaouif441d3a2012-04-22 15:17:52 -070092
Meki Cherkaouif441d3a2012-04-22 15:17:52 -070093
Meki Cherkaoui09847972012-06-06 03:26:30 -070094 in = sock.getInputStream();
Meki Cherkaouif441d3a2012-04-22 15:17:52 -070095
Meki Cherkaoui09847972012-06-06 03:26:30 -070096 out=sock.getOutputStream();
Meki Cherkaouif441d3a2012-04-22 15:17:52 -070097
Meki Cherkaoui09847972012-06-06 03:26:30 -070098
99 System.out.println("Your string is"+word);
100
101 out.write(hex2Bytes(word));
102 out.flush();
103 sock.shutdownOutput();
104
105 ByteArrayOutputStream serverinput=new ByteArrayOutputStream();
106
107 int len=0;
108 byte[] buf=new byte[PACKETSIZE];
109 while ((len = in.read(buf))>=0) {
110 serverinput.write(buf, 0, len);
111 }
112
113 String outputString = bytes2Hex(buf);
114
115 System.out.println("Your string is "+word+" converted to byte "+outputString);
116
117 return outputString;
118
119 } catch (Exception e) {
120 // TODO Auto-generated catch block
121 error(e);
Meki Cherkaouif441d3a2012-04-22 15:17:52 -0700122 }
123
Meki Cherkaoui09847972012-06-06 03:26:30 -0700124
125 finally{
126
127 try {
128 sock.close();
129 } catch (IOException e) {
130 // TODO Auto-generated catch block
131 error(e);
132 }
133
134 }
135
136 return "ERROR";
Meki Cherkaouif441d3a2012-04-22 15:17:52 -0700137 }
138 }
Meki Cherkaoui09847972012-06-06 03:26:30 -0700139
Meki Cherkaouif441d3a2012-04-22 15:17:52 -0700140 );
Meki Cherkaoui09847972012-06-06 03:26:30 -0700141 }
142
143 public String get(final String h, final int p, final String interest,final int timeout){
144 return AccessController.doPrivileged(
145 new PrivilegedAction<String>() {
146 public String run() {
147 Thread t = new Thread( new Runnable(){
148 public void run(){
149
150 SocketChannel sChannelCloser = null;
151 try{
152
153 final SocketChannel sChannel = open(h,p);
154
155 sChannelCloser=sChannel;
156
157 sChannel.socket().setSoTimeout(timeout);
158
159 ByteBuffer buffer = ByteBuffer.wrap(hex2Bytes(interest));
160
161 System.out.println("WRITING BYTES:"+interest);
162
163 while(buffer.hasRemaining())
164 sChannel.write(buffer);
165
166 ByteBuffer bufferReceiver = ByteBuffer.allocate(PACKETSIZE);
167
168 buffer.clear();
169 sChannel.read(bufferReceiver);
170
jefffe2cdeb2012-09-09 17:46:10 -0700171 String output = bytes2Hex(bufferReceiver.array(), bufferReceiver.position());
Meki Cherkaoui09847972012-06-06 03:26:30 -0700172 System.out.println("RECEIVED BYTES:" +output);
173
174 result=output;
175
176 return ;
177
178 } catch (Exception e) {
179 // TODO Auto-generated catch block
180 error(e);
181 }
182 finally{
183
184 try {
185 sChannelCloser.close();
186 } catch (IOException e) {
187 // TODO Auto-generated catch block
188 error(e);
189 }
190
191 }
192
193
194
195 //return "STARTED GETTING";
196
197 }
198 }
199
200 );
201
202 t.start();
203
204 Long start = System.currentTimeMillis();
205 Long current = System.currentTimeMillis();
206
207 while(t.isAlive() && current-start < timeout ){
208 try {
209 Thread.sleep(100);
210 } catch (InterruptedException e) {
211 error(e);
212 }
213 current = System.currentTimeMillis();
214 }
215 if(current-start >= timeout){
216 t.stop();
217 return "TIMEOUT EXPIRED";
218 }
219 else{
220 return result;
221
222 }
223
224
225 }
226 }
227
228 );
229 }
230
231
232 // Report an error
233 public static void receivedInterest( String data,String name){
234
235 Object[] arguments = new Object[2];
236 arguments[0] = data;
237 arguments[1] = name;
238
239
240 try {
241 browser.call("on_socket_received_interest", arguments);
242 } catch (JSException e) {
243 // TODO Auto-generated catch block
244 error(e.getMessage());
245 }
Meki Cherkaouif441d3a2012-04-22 15:17:52 -0700246
247 }
Meki Cherkaouiabb973b2012-05-09 14:25:57 -0700248
Meki Cherkaoui09847972012-06-06 03:26:30 -0700249 public String put(final String h, final int p, final String interest,final String name, final String toReturn){
Meki Cherkaouiabb973b2012-05-09 14:25:57 -0700250 return AccessController.doPrivileged(
251 new PrivilegedAction<String>() {
252 public String run() {
253
Meki Cherkaouiabb973b2012-05-09 14:25:57 -0700254
Meki Cherkaoui09847972012-06-06 03:26:30 -0700255 SocketChannel sChannelCloser = null;
256 try{
257
258 final SocketChannel sChannel = open(h,p);
259 sChannelCloser=sChannel;
260
261 //FIRST TIME
262 //ByteBuffer buffer = ByteBuffer.allocateDirect(1024);
263
264 ByteBuffer buffer = ByteBuffer.wrap(hex2Bytes(interest));
265
266 System.out.println("WRITING BYTES:"+interest);
267 while(buffer.hasRemaining())
268 sChannel.write(buffer);
269
270 ByteBuffer bufferReceiver = ByteBuffer.allocate(PACKETSIZE);
271
272 buffer.clear();
273 sChannel.read(bufferReceiver);
274
275 System.out.println("RECEIVED BYTES:" + bytes2Hex(bufferReceiver.array()));
Meki Cherkaouiabb973b2012-05-09 14:25:57 -0700276
277
Meki Cherkaouiabb973b2012-05-09 14:25:57 -0700278
Meki Cherkaoui09847972012-06-06 03:26:30 -0700279
280 Thread t = new Thread( new Runnable(){
281 public void run(){
282 //sChannel.
283 while(true){
284
285 try{
286
287 ByteBuffer bufferReceiver = ByteBuffer.allocate(PACKETSIZE);
288
289 bufferReceiver.clear();
290 sChannel.read(bufferReceiver);
291
292 String receivedHexBytes = bytes2Hex(bufferReceiver.array());
293
294 System.out.println("RECEIVED BYTES:" + receivedHexBytes);
295
296
297 System.out.println("name is "+name);
298
299 //connections.put(name, sChannel);
300
301 //System.out.println("name is "+name);
302
303 //receivedInterest(receivedHexBytes,name);
304
305
306 //byte[] output = hex2Bytes("048202aa03b208855dea25cca4d3967c774cc6e709a140d91f9d74e97a665cbb106568ee94f998d8b22fbe2b8d2fc43bd9363b501a50f2d770a7882aaf0792c20359f54da27d4a5b5a29be7d349c656e60fd37c92cf4e4aae256af04161e561aa4323512b38799c43d7a2ec4e35c3e19599b12c5ee3a5f0994837461c05c294a8b596f960e9287520000f2faad726f63636f000001a203e2028548398bad0eeb58e9cc64720e84f4947fe1c1eb310055181ed0b4c2d920ef6e590002bab504fcc5336e9c0001e201da0a9530819f300d06092a864886f70d010101050003818d003081890281810092e67426906bae66a3f4910bade5a2d24e2b7ed0d7a3e16f368c258e848f30115f6e95f5e0ee64505ed3da08be6ee599d395f611ffb096a9c258171518f0c6b3612a94681d29e44619227ac268e5d450abac89820d96188f507d15fb40d8780ccb76a012f7ce4f4efe2b8ba431ef993e31da867adffb069003808bceef9ff4d10203010001000000019abd424f4e4a4f55520000");
307
308 byte[] output = hex2Bytes(toReturn);
309
310
311 ByteBuffer outputBuffer = ByteBuffer.wrap(output);
312
313 //byte[] output = hex2Bytes("048202aa03b208857d7f003e50fc79aca1563842832db26c5e313bec0940ce795dd8adc34e7fd2cadee7b44b28737d59c061240da60d0733e2bcc760c7656a0f03b20a987c1a1fb94bb93648243c48fde222bc21b85062f186ffdc15f637cfe83f35ab11e3564e7e83a26de39a0faf3991f469f0f376fca535fb1be28ede72b433547b4977f0f3000000f2faa574657374000001a203e20285189f9df9814d134883758f9c5541ba957a4464d8756f34870cf981143f56779a0002bab504fcbf24f6f60001e201da0a9530819f300d06092a864886f70d010101050003818d0030818902818100c0a2c68770c339ed3152b90cde701ba588652f358854460b36b866c6e76272013232df351f10841ac49e35a6bc644f9c9caacd9aa0cd0e1835a34162c9208049d3f1f893d0b9566854133a763756df45297328d595ba6b6459fd311d5e1c97ce5278fa076dde765090c7221670ad54689958cc5fb46699482c5ac16c301dba1f0203010001000000019abd424f4e4a4f55520000");
314
315 while(outputBuffer.hasRemaining())
316 sChannel.write(outputBuffer);
317
318 System.out.println("SENT BACK SOME DATA");
319
320
321 }
322 catch(Exception e){
323 error(e);
324 try {
325 sChannel.close();
326 } catch (IOException e1) {
327 // TODO Auto-generated catch block
328 error(e1);
329 }
330 System.exit(0);
331
332 }
333 }
334
335 }});
336
337 t.start();
338
339 return "STARTED PUBLISHING";
340
341 //return receivedHexBytes;
342
343 } catch (Exception e) {
344 // TODO Auto-generated catch block
345 error(e);
346
347 try {
348 System.out.println("CLOSING THE CONNECTION");
349 sChannelCloser.close();
350 } catch (IOException ex) {
351 // TODO Auto-generated catch block
352 error(ex);
353
354 }
Meki Cherkaouiabb973b2012-05-09 14:25:57 -0700355 }
Meki Cherkaoui09847972012-06-06 03:26:30 -0700356 return "FAILURE";
Meki Cherkaouiabb973b2012-05-09 14:25:57 -0700357
Meki Cherkaoui09847972012-06-06 03:26:30 -0700358
359
Meki Cherkaouiabb973b2012-05-09 14:25:57 -0700360 }
361 }
362 );
Meki Cherkaoui09847972012-06-06 03:26:30 -0700363 }
364
365
366
Axel Colin de Verdiered363e632012-06-06 05:16:43 -0700367 /**
368 * Not used
369 */
Meki Cherkaoui09847972012-06-06 03:26:30 -0700370 public String putAnswer(final String s, final String dataBack){
371
372 final SocketChannel sChannel = connections.get(s);
373
374
375 byte[] output = hex2Bytes(dataBack);
376
377 ByteBuffer outputBuffer = ByteBuffer.wrap(output);
378
379 //byte[] output = hex2Bytes("048202aa03b208857d7f003e50fc79aca1563842832db26c5e313bec0940ce795dd8adc34e7fd2cadee7b44b28737d59c061240da60d0733e2bcc760c7656a0f03b20a987c1a1fb94bb93648243c48fde222bc21b85062f186ffdc15f637cfe83f35ab11e3564e7e83a26de39a0faf3991f469f0f376fca535fb1be28ede72b433547b4977f0f3000000f2faa574657374000001a203e20285189f9df9814d134883758f9c5541ba957a4464d8756f34870cf981143f56779a0002bab504fcbf24f6f60001e201da0a9530819f300d06092a864886f70d010101050003818d0030818902818100c0a2c68770c339ed3152b90cde701ba588652f358854460b36b866c6e76272013232df351f10841ac49e35a6bc644f9c9caacd9aa0cd0e1835a34162c9208049d3f1f893d0b9566854133a763756df45297328d595ba6b6459fd311d5e1c97ce5278fa076dde765090c7221670ad54689958cc5fb46699482c5ac16c301dba1f0203010001000000019abd424f4e4a4f55520000");
380
381
382
383 try{
384 while(outputBuffer.hasRemaining())
385 sChannel.write(outputBuffer);
386
387
388 ByteBuffer bufferReceiver = ByteBuffer.allocate(PACKETSIZE);
389
390 bufferReceiver.clear();
391 sChannel.read(bufferReceiver);
392
393 String receivedHexBytes = bytes2Hex(bufferReceiver.array());
394 System.out.println("RECEIVED BYTES:" + receivedHexBytes);
395
396
397 receivedInterest(receivedHexBytes,s);
398
399 }
400 catch (Exception e) {
401 // TODO Auto-generated catch block
402 error(e);
403
404 try {
405 System.out.println("CLOSING THE CONNECTION");
406 sChannel.close();
407 } catch (IOException ex) {
408 // TODO Auto-generated catch block
409 error(ex);
410 return "FAILURE";
411 }
412 }
413
414 return "SUCCESS";
Meki Cherkaouiabb973b2012-05-09 14:25:57 -0700415
416 }
417
Meki Cherkaoui09847972012-06-06 03:26:30 -0700418
419 public SocketChannel open(String host, int ip) throws IOException{
420 // Create a non-blocking socket channel
421 SocketChannel sChannel = SocketChannel.open();
422
423 //sChannel.configureBlocking(false);
424
425 // Send a connection request to the server; this method is non-blocking
426 sChannel.connect(new InetSocketAddress(host, ip));
427
428 // Before the socket is usable, the connection must be completed
429 // by calling finishConnect(), which is non-blocking
430
431 _ncReadSelector = Selector.open();
432 //sChannel.configureBlocking(false);
433 //sChannel.register(_ncReadSelector, SelectionKey.OP_READ);
434 _ncWriteSelector = Selector.open();
435 //sChannel.register(_ncWriteSelector, SelectionKey.OP_WRITE);
436
437
438 while (!sChannel.finishConnect()) {
439 // Do something else
440 System.out.println("TRYING TO CONNECT");
441 }
442 System.out.println("CONNECTED TO " +host +":"+ip);
443
444 return sChannel;
445 }
446
447
448 public static void error(Exception ex){
449 StringWriter sw = new StringWriter();
450 ex.printStackTrace(new PrintWriter(sw));
451 String exceptionAsStrting = sw.toString();
452
453 error(exceptionAsStrting );
454 }
455 // Report an error
456 public static void error(String message){
457
458 System.out.println("RECEIVED AN ERROR");
459 message = "Java Socket Bridge ERROR: " + message;
460 Object[] arguments = new Object[1];
461 arguments[0] = message;
462
463 if(isBrowser){
464 try {
465 browser.call("on_socket_error", arguments);
466 } catch (JSException e) {
467 // TODO Auto-generated catch block
468 e.printStackTrace();
469 }
470 }
471 else{
472 System.out.println(message);
473 }
474 }
475
476
477
478
479 // Log something
480 public void log(String message){
481 System.out.println(message);
482 }
483
484
485 public static byte[] hex2Bytes(String str)
Meki Cherkaouif441d3a2012-04-22 15:17:52 -0700486 {
487 byte[] bytes = new byte[str.length() / 2];
488 for (int i = 0; i < bytes.length; i++)
489 {
490 bytes[i] = (byte) Integer
491 .parseInt(str.substring(2 * i, 2 * i + 2), 16);
492 }
493
494 return bytes;
495 }
jefffe2cdeb2012-09-09 17:46:10 -0700496 public static String bytes2Hex(byte[] b, int length)
Meki Cherkaouif441d3a2012-04-22 15:17:52 -0700497 {
498 // String Buffer can be used instead
499 String hs = "";
500 String stmp = "";
501
jefffe2cdeb2012-09-09 17:46:10 -0700502 for (int n = 0; n < length; n++)
Meki Cherkaouif441d3a2012-04-22 15:17:52 -0700503 {
504 stmp = (java.lang.Integer.toHexString(b[n] & 0XFF));
505
506 if (stmp.length() == 1)
507 {
508 hs = hs + "0" + stmp;
509 }
510 else
511 {
512 hs = hs + stmp;
513 }
514
jefffe2cdeb2012-09-09 17:46:10 -0700515 if (n < length - 1)
Meki Cherkaouif441d3a2012-04-22 15:17:52 -0700516 {
517 hs = hs + "";
518 }
519 }
520
521 return hs;
522 }
jefffe2cdeb2012-09-09 17:46:10 -0700523 public static String bytes2Hex(byte[] b)
524 {
525 return bytes2Hex(b, b.length);
526 }
Meki Cherkaouif441d3a2012-04-22 15:17:52 -0700527
528
Meki Cherkaoui09847972012-06-06 03:26:30 -0700529 public static void main(String[] args) throws IOException {
Meki Cherkaouif441d3a2012-04-22 15:17:52 -0700530
Meki Cherkaoui09847972012-06-06 03:26:30 -0700531 JavaSocketBridge b = new JavaSocketBridge();
532
533 //System.out.println( b.get("127.0.0.1",9695 ,"01D2F2FAA4657374000000", 1000));
534
535 //System.out.println( b.get("127.0.0.1",9695 ,"01D2F2FAA574657374000000", 1000));
536
537 //System.out.println( b.putSend("127.0.0.1",9695 ,"01d2f2faa563636e7800fa0285e0a01e093968f9740ce7f4361babf5bb05a4e55aaca5e58f73eddeb8e013aa8f00fabd73656c6672656700fa1bf5048202aa03b2088568cf069cdfdedad97ad9358f7e2446ca581eaa22ed9eb4e482fe616b35840533ba4f9d321155d6c34915dff7352de5e60bddb17e32f893cd89056cfd291011a5c3742312a083c2628fed4ddffb04cf51e6860eb1dbd43ff9b59736e62ec1a69218ce0acfdd9da896a617f609c12225f14a63876488b38d3a7b9fc1757d9058470000f20001a203e2028547ab87ece0e191c5e946f839507bc875c63c7032e42c347c135a952e7187c9300002bab504fcb2a6a0250001e201da0a9530819f300d06092a864886f70d010101050003818d003081890281810089b8f8b42d8aa31148d9f2a0c38d3fee7c73f60ea444d08fd886114a689cfe235c49bf9e256489390c19d961aabd5ee6d9e9e133282cd68b046609fe0a81be76c683cb150f3d035231b25745530fc887fbd137d6ef9c05d795fdb78f84eeab6f7dcbd1aa64b3920d96cfe941b66967bb2892baef1995bea231a4dc89c383e8550203010001000000019a0585058a04cabe73656c6672656700f2faad726f63636f000003e20285e0a01e093968f9740ce7f4361babf5bb05a4e55aaca5e58f73eddeb8e013aa8f0004fa8e330003d2d63231343734383336343700000000000002d28e310000",1000));
538
539 //System.out.println( b.putSend("127.0.0.1",9695 ,"01D2F2FAA574657374000000",1000));
Meki Cherkaouif441d3a2012-04-22 15:17:52 -0700540
541
Meki Cherkaoui09847972012-06-06 03:26:30 -0700542 //System.out.println( b.getSend("127.0.0.1",9695 ,"01D2F2FAA574657374000000", 1000));
Meki Cherkaouif441d3a2012-04-22 15:17:52 -0700543
Meki Cherkaoui09847972012-06-06 03:26:30 -0700544 //System.out.println( b.get("localhost",9695 ,"01d2f2fafd",3000));
545
546 //System.out.println( b.get("localhost",9695 ,"01D2F2FAA574657374000",3000));
Meki Cherkaouiabb973b2012-05-09 14:25:57 -0700547
548
Meki Cherkaoui09847972012-06-06 03:26:30 -0700549 //System.out.println( b.getOLD("localhost",9695 ,"01d2f2fafdc12e4d2e532e6c6f63616c686f737400fabdc12e4d2e53525600faa563636e6400fa9d4b4559000002d28e310000",1000));
Meki Cherkaouiabb973b2012-05-09 14:25:57 -0700550
551
Meki Cherkaoui09847972012-06-06 03:26:30 -0700552 //System.out.println( b.putSend("localhost",9695 ,"01d2f2faa563636e7800fa0285e0a01e093968f9740ce7f4361babf5bb05a4e55aaca5e58f73eddeb8e013aa8f00fabd73656c6672656700fa1bf5048202aa03b208854a18988c72aee624da28e2e1acbccb209b8e89429041985521ed68f95a1c546872fba3d854b1377dc249b6d8ec5935e5069256c97a7f6d8a62e86222ccd2cfe5097aed3fe5ede6732ce191a8680d78e39d0c5058a2b7bb0f0687994e9f045de346b66c46498547a08da1f2f0cdfafba3afdfe7107931935ede79040137ba94a90000f20001a203e202851a4860caa4991e829bcdc9429fb711d52440968d23560726606050bf147acffc0002bab504fcb3f03aa40001e201da0a9530819f300d06092a864886f70d010101050003818d00308189028181008ed27580e3d1c4c67672208665133a1ba12d8ebf5cad8e054571926b3ff0782a04c71703384021a6cefb6616b66cbd8a679b761d69d6373a851546e26f7105510b4c23be9a3c7f2e652e100ecc1471855730659f1477ce4e8504ad1fd8f44116baaeae2ff67eec33abba790157a79bf5039e5a528a471d9d67c94e70117ed7490203010001000000019a0585058a04cabe73656c6672656700f2faad726f63636f000003e20285e0a01e093968f9740ce7f4361babf5bb05a4e55aaca5e58f73eddeb8e013aa8f0004fa8e330003d2d63231343734383336343700000000000002d28e310000", 1000));
Meki Cherkaouiabb973b2012-05-09 14:25:57 -0700553
Meki Cherkaoui09847972012-06-06 03:26:30 -0700554 //b.putSend("localhost",9695 ,"01d2f2faa563636e7800fa0285e0a01e093968f9740ce7f4361babf5bb05a4e55aaca5e58f73eddeb8e013aa8f00fabd73656c6672656700fa1bf5048202aa03b208854a18988c72aee624da28e2e1acbccb209b8e89429041985521ed68f95a1c546872fba3d854b1377dc249b6d8ec5935e5069256c97a7f6d8a62e86222ccd2cfe5097aed3fe5ede6732ce191a8680d78e39d0c5058a2b7bb0f0687994e9f045de346b66c46498547a08da1f2f0cdfafba3afdfe7107931935ede79040137ba94a90000f20001a203e202851a4860caa4991e829bcdc9429fb711d52440968d23560726606050bf147acffc0002bab504fcb3f03aa40001e201da0a9530819f300d06092a864886f70d010101050003818d00308189028181008ed27580e3d1c4c67672208665133a1ba12d8ebf5cad8e054571926b3ff0782a04c71703384021a6cefb6616b66cbd8a679b761d69d6373a851546e26f7105510b4c23be9a3c7f2e652e100ecc1471855730659f1477ce4e8504ad1fd8f44116baaeae2ff67eec33abba790157a79bf5039e5a528a471d9d67c94e70117ed7490203010001000000019a0585058a04cabe73656c6672656700f2faad726f63636f000003e20285e0a01e093968f9740ce7f4361babf5bb05a4e55aaca5e58f73eddeb8e013aa8f0004fa8e330003d2d63231343734383336343700000000000002d28e310000", 1000);
Meki Cherkaouiabb973b2012-05-09 14:25:57 -0700555
Meki Cherkaoui09847972012-06-06 03:26:30 -0700556 //NewTest(54567);
Meki Cherkaouiabb973b2012-05-09 14:25:57 -0700557
Meki Cherkaoui09847972012-06-06 03:26:30 -0700558 //System.out.println( b.put());
Meki Cherkaouiabb973b2012-05-09 14:25:57 -0700559
Meki Cherkaoui09847972012-06-06 03:26:30 -0700560 //connections.put("meki", SocketChannel.open());
Meki Cherkaouiabb973b2012-05-09 14:25:57 -0700561
562 }
Meki Cherkaouif441d3a2012-04-22 15:17:52 -0700563
564}