Urbi SDK Remote for Java  2.7.5
UClient.java
00001 /* ----------------------------------------------------------------------------
00002  * This file was automatically generated by SWIG (http://www.swig.org).
00003  * Version 2.0.4
00004  *
00005  * Do not make changes to this file unless you know what you are doing--modify
00006  * the SWIG interface file instead.
00007  * ----------------------------------------------------------------------------- */
00008 
00009 package urbi;
00010   ///Linux implementation of UAbstractClient.
00011   /*! This implementation uses a shared thread between all the instances to
00012    * handle Socket operations, and call the registered callbacks in that thread.
00013   */
00014 
00015 public class UClient extends UAbstractClient {
00016   private long swigCPtr;
00017 
00018   public UClient(long cPtr, boolean cMemoryOwn) {
00019     super(urbiJNI.UClient_SWIGUpcast(cPtr), cMemoryOwn);
00020     swigCPtr = cPtr;
00021   }
00022 
00023   public static long getCPtr(UClient obj) {
00024     return (obj == null) ? 0 : obj.swigCPtr;
00025   }
00026 
00027   protected void finalize() {
00028     delete();
00029   }
00030 
00031   public synchronized void delete() {
00032     if (swigCPtr != 0) {
00033       if (swigCMemOwn) {
00034         swigCMemOwn = false;
00035         urbiJNI.delete_UClient(swigCPtr);
00036       }
00037       swigCPtr = 0;
00038     }
00039     super.delete();
00040   }
00041 
00042   public UClient(String host, long port, long buflen) {
00043     this(urbiJNI.new_UClient__SWIG_0(host, port, buflen), true);
00044   }
00045 
00046   public UClient(String host, long port) {
00047     this(urbiJNI.new_UClient__SWIG_1(host, port), true);
00048   }
00049 
00050   public UClient(String host) {
00051     this(urbiJNI.new_UClient__SWIG_2(host), true);
00052   }
00053 
00054   public UClient() {
00055     this(urbiJNI.new_UClient__SWIG_3(), true);
00056   }
00057 
00058       /** Block until kernel version is available or an error occurrs.
00059      * Message processing must not depend on this thread.
00060      */
00061  public  void waitForKernelVersion() {
00062     urbiJNI.UClient_waitForKernelVersion(swigCPtr, this);
00063   }
00064 
00065       /// Bounce to listen or connect, depending whether server mode.
00066  public  int start() {
00067     return urbiJNI.UClient_start(swigCPtr, this);
00068   }
00069 
00070   public int closeUClient() {
00071     return urbiJNI.UClient_closeUClient(swigCPtr, this);
00072   }
00073 
00074   public void printf(String format) {
00075     urbiJNI.UClient_printf(swigCPtr, this, format);
00076   }
00077 
00078       /// Get time in milliseconds since an unspecified but constant
00079     /// reference time.
00080  public  long getCurrentTime() {
00081     return urbiJNI.UClient_getCurrentTime(swigCPtr, this);
00082   }
00083 
00084   public void setKeepAliveCheck(long pingInterval, long pongTimeout) {
00085     urbiJNI.UClient_setKeepAliveCheck(swigCPtr, this, pingInterval, pongTimeout);
00086   }
00087 
00088       /// Send the remainder of the stream.
00089  public  int send(String format) {
00090     return urbiJNI.UClient_send_SWIG_0_0(swigCPtr, this, format);
00091   }
00092 
00093       /// Send the remainder of the stream.
00094  public  int send(UValue v) {
00095     return urbiJNI.UClient_send_SWIG_0_2(swigCPtr, this, UValue.getCPtr(v), v);
00096   }
00097 
00098   public void setSynchronousSend(boolean enable) {
00099     urbiJNI.UClient_setSynchronousSend(swigCPtr, this, enable);
00100   }
00101 
00102 }