Index: src/client/c/hu/varadiistvan/xplra/xplra.cc
===================================================================
--- src/client/c/hu/varadiistvan/xplra/xplra.cc	(revision 58)
+++ src/client/c/hu/varadiistvan/xplra/xplra.cc	(revision 70)
@@ -1373,6 +1373,34 @@
     if (connection==0) return -1;
 
+    connection->disconnect();
+
+    return 0;
+}
+
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+
+extern "C" int xplra_reconnect(int connectionID)
+{
+    Connection* connection = ConnectionSlot::getValue(connectionID);
+    if (connection==0) return -1;
+
+    try {
+        connection->connect();
+        return 0;
+    } catch(...) {
+        return -1;
+    }
+}
+
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+
+extern "C" int xplra_destroy(int connectionID)
+{
+    Connection* connection = ConnectionSlot::getValue(connectionID);
+    if (connection==0) return -1;
+
     ConnectionSlot::clearValue(connectionID);
-    connection->disconnect();
     delete connection;
 
Index: src/client/c/hu/varadiistvan/xplra/xplra.h
===================================================================
--- src/client/c/hu/varadiistvan/xplra/xplra.h	(revision 58)
+++ src/client/c/hu/varadiistvan/xplra/xplra.h	(revision 70)
@@ -32,4 +32,8 @@
 /*----------------------------------------------------------------------------*/
 
+/** @file */
+
+/*----------------------------------------------------------------------------*/
+
 #include <stdlib.h>
 #include <inttypes.h>
@@ -107,4 +111,8 @@
 /*----------------------------------------------------------------------------*/
 
+/**
+ * This ID is returned by multi-dataref buffer functions when the
+ * buffer is not found, this the dataref cannot be assigned an ID
+ */
 #define INVALID_DATAREF_ID ((size_t)-1)
 
@@ -193,4 +201,6 @@
  * @param length the length of the destination buffer
  * @param offset the offset from which to query the array
+ * @param connectionID the ID of the connection to use
+ * @param name the name of the dataref
  *
  * @return the actual number of elements returned in case of success,
@@ -209,4 +219,6 @@
  * less than or equal to the input value.
  * @param offset the offset from which to query the array
+ * @param connectionID the ID of the connection to use
+ * @param name the name of the dataref
  *
  * @return the new array on success, 0 on error
@@ -223,4 +235,6 @@
  * @param length the length of the destination buffer
  * @param offset the offset from which to query the array
+ * @param connectionID the ID of the connection to use
+ * @param name the name of the dataref
  *
  * @return the actual number of elements returned in case of success,
@@ -239,4 +253,6 @@
  * less than or equal to the input value.
  * @param offset the offset from which to query the array
+ * @param connectionID the ID of the connection to use
+ * @param name the name of the dataref
  *
  * @return the new array on success, 0 on error
@@ -253,4 +269,6 @@
  * @param length the length of the destination buffer
  * @param offset the offset from which to query the array
+ * @param connectionID the ID of the connection to use
+ * @param name the name of the dataref
  *
  * @return the actual number of elements returned in case of success,
@@ -269,4 +287,6 @@
  * less than or equal to the input value.
  * @param offset the offset from which to query the array
+ * @param connectionID the ID of the connection to use
+ * @param name the name of the dataref
  *
  * @return the new array on success, 0 on error
@@ -497,4 +517,6 @@
  *
  * @param dest pointer to the variable that will receive the value
+ * @param bufferID the ID of the buffer to use
+ * @param datarefID the ID of the dataref whose value is to be retrieved
  *
  * @return 0 on success, -1 on error.
@@ -535,4 +557,6 @@
  *
  * @param dest pointer to the variable that will receive the value
+ * @param bufferID the ID of the buffer to use
+ * @param datarefID the ID of the dataref whose value is to be retrieved
  *
  * @return 0 on success, -1 on error.
@@ -573,4 +597,6 @@
  *
  * @param dest pointer to the variable that will receive the value
+ * @param bufferID the ID of the buffer to use
+ * @param datarefID the ID of the dataref whose value is to be retrieved
  *
  * @return 0 on success, -1 on error.
@@ -601,4 +627,7 @@
  * Set the contents of the float array dataref with the given ID.
  *
+ * @param bufferID the ID of the buffer to use
+ * @param datarefID the ID of the dataref whose value is to be set
+ * @param value the array to set
  * @param length the amount of data. If 0, it is assumed to be the
  * length of the data in the buffer minus the offset.
@@ -616,7 +645,10 @@
  * Get the contents of the float array with the given ID.
  *
+ * @param value the destination buffer
  * @param length the amount of data. If 0, it is assumed to be the
  * length of the data in the buffer minus the offset.
  * @param offset the offset within the buffer to get the data from
+ * @param bufferID the ID of the buffer to use
+ * @param datarefID the ID of the dataref whose value is to be retrieved
  *
  * @return the number of data items retrieved, or -1 on error.
@@ -631,4 +663,6 @@
  * Get a pointer to the float array with the given ID.
  *
+ * @param bufferID the ID of the buffer to use
+ * @param datarefID the ID of the dataref whose value is to be retrieved
  * @param offset the offset within the buffer.
  *
@@ -643,4 +677,7 @@
  * Set the contents of the integer array dataref with the given ID.
  *
+ * @param bufferID the ID of the buffer to use
+ * @param datarefID the ID of the dataref whose value is to be set
+ * @param value the array to set
  * @param length the amount of data. If 0, it is assumed to be the
  * length of the data in the buffer minus the offset.
@@ -658,7 +695,10 @@
  * Get the contents of the integer array with the given ID.
  *
+ * @param value the destination buffer
  * @param length the amount of data. If 0, it is assumed to be the
  * length of the data in the buffer minus the offset.
  * @param offset the offset within the buffer to get the data from
+ * @param bufferID the ID of the buffer to use
+ * @param datarefID the ID of the dataref whose value is to be retrieved
  *
  * @return the number of data items retrieved, or -1 on error.
@@ -673,4 +713,6 @@
  * Get a pointer to the integer array with the given ID.
  *
+ * @param bufferID the ID of the buffer to use
+ * @param datarefID the ID of the dataref whose value is to be retrieved
  * @param offset the offset within the buffer.
  *
@@ -685,4 +727,7 @@
  * Set the contents of the byte array dataref with the given ID.
  *
+ * @param bufferID the ID of the buffer to use
+ * @param datarefID the ID of the dataref whose value is to be set
+ * @param value the array to set
  * @param length the amount of data. If 0, it is assumed to be the
  * length of the data in the buffer minus the offset.
@@ -700,7 +745,10 @@
  * Get the contents of the byte array with the given ID.
  *
+ * @param value the destination buffer
  * @param length the amount of data. If 0, it is assumed to be the
  * length of the data in the buffer minus the offset.
  * @param offset the offset within the buffer to get the data from
+ * @param bufferID the ID of the buffer to use
+ * @param datarefID the ID of the dataref whose value is to be retrieved
  *
  * @return the number of data items retrieved, or -1 on error.
@@ -715,4 +763,6 @@
  * Get a pointer to the byte array with the given ID.
  *
+ * @param bufferID the ID of the buffer to use
+ * @param datarefID the ID of the dataref whose value is to be retrieved
  * @param offset the offset within the buffer.
  *
@@ -752,4 +802,5 @@
  * @param connectionID the ID of the connection for which the buffer
  * has been created.
+ * @param bufferID the ID of the buffer to destroy
  *
  * @return 0 on success, -1 on error.
@@ -793,9 +844,28 @@
 
 /**
+ * Disconnect the connection with the given ID.
+ *
+ * @return 0 on success, -1 on error.
+ */
+int xplra_disconnect(int connectionID);
+
+/*----------------------------------------------------------------------------*/
+
+/**
+ * Reconnect the connection with the given ID. If it is already
+ * connected, nothing happens.
+ *
+ * @return 0 on success, -1 on error.
+ */
+int xplra_reconnect(int connectionID);
+
+/*----------------------------------------------------------------------------*/
+
+/**
  * Destroy the connection with the given ID.
  *
  * @return 0 on success, -1 on error.
  */
-int xplra_disconnect(int connectionID);
+int xplra_destroy(int connectionID);
 
 /*----------------------------------------------------------------------------*/
