+ public static void main(String[] args) {
+ SocketClient client = null;
+ Thread thS = null;
+ Thread thR = null;
+
+ try {
+ client = new SocketClient();
+ thS = new Thread(new ThreadClientoSend(client));
+ thR = new Thread(new ThreadClientoReceive(client));
+ thS.setName("thoS");
+ thS.start();
+ thR.setName("thoR");
+ thR.start();
+ }
+ catch (Exception e) {
+ System.err.println("Exception: " + e);
+ }
+ finally {
+ try {
+ thS.join();
+ thR.join();
+ }
+ catch (InterruptedException e) {
+ System.err.println("InterruptedException: " + e);
+ e.printStackTrace();
+ }
+ client.closeRWIO();
+ }
+ }
+