comparison src/org/dancres/blitz/remote/nio/Client.java @ 0:3dc0c5604566

Initial checkin of blitz 2.0 fcs - no installer yet.
author Dan Creswell <dan.creswell@gmail.com>
date Sat, 21 Mar 2009 11:00:06 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:3dc0c5604566
1 package org.dancres.blitz.remote.nio;
2
3 import org.dancres.blitz.test.DummyEntry;
4 import org.dancres.blitz.mangler.EntryMangler;
5
6 import java.io.*;
7 import java.net.Socket;
8 import java.net.InetSocketAddress;
9
10 import net.jini.core.lease.Lease;
11
12 /**
13 */
14 public class Client implements Runnable {
15 private Invoker _invoker;
16
17 Client(InetSocketAddress anAddr) throws IOException {
18 _invoker = new Invoker(anAddr, true);
19 new Thread(this).start();
20 }
21
22 public void run() {
23 // while(true) {
24 try {
25
26 _invoker.write(EntryMangler.getMangler().mangle(new DummyEntry("555555")),
27 null, Lease.FOREVER);
28
29 } catch (Exception anE) {
30 System.err.println("Rdv error");
31 anE.printStackTrace(System.err);
32 // break;
33 }
34 // }
35 }
36
37 public static void main(String args[]) {
38 try {
39 new Client(new InetSocketAddress(args[0],
40 Integer.parseInt(args[1])));
41
42 } catch (Exception anE) {
43 System.err.println("Client error");
44 anE.printStackTrace(System.err);
45 }
46 }
47 }