public void send(
     String functionName,
     Class[] paramTypes,
     Object[] funcArgValues,
     Object state,
     Class stateDType) {
   try {
     new Sending(new Pack(functionName, stateDType, state, funcArgValues, paramTypes)).send();
   } catch (Exception ex) {
     callingparent.setResult(null, null);
   }
 }
  public boolean connect() {
    mysocket = new Socket();
    try {
      mysocket.connect(
          new InetSocketAddress(Inet4Address.getByAddress(serverAddress), portnum),
          NetInfo.waitTime);

      startTime = System.currentTimeMillis();
      in = mysocket.getInputStream();
      out = mysocket.getOutputStream();

      oos = new ObjectOutputStream(out);

      ois = new ObjectInputStream(in);
      return true;
    } catch (IOException ex) {
      callingparent.setResult(null, null);
      return false;
    }
  }