Index: include/libroar/socket.h
===================================================================
--- include/libroar/socket.h	(revision 5248)
+++ include/libroar/socket.h	(revision 5260)
@@ -50,6 +50,6 @@
 #define ROAR_SOCKET_MAX_HOSTNAMELEN 64
 
-int roar_socket_listen  (int type, char * host, int port);
-int roar_socket_connect (char * host, int port);
+int roar_socket_listen  (int type, const char * host, int port);
+int roar_socket_connect (const char * host, int port);
 
 // TODO: those function should be made /static/.
@@ -61,8 +61,8 @@
 int roar_socket_new        (int type);
 
-int roar_socket_open       (int mode, int type, char * host, int port);
-int roar_socket_open_fork  (int mode, char * host, int port);
-int roar_socket_open_file  (int mode, char * host, int port);
-int roar_socket_open_proxy (int mode, int type, char * host, int port, char * proxy_type);
+int roar_socket_open       (int mode, int type, const char * host, int port);
+int roar_socket_open_fork  (int mode, const char * host, int port);
+int roar_socket_open_file  (int mode, const char * host, int port);
+int roar_socket_open_proxy (int mode, int type, const char * host, int port, const char * proxy_type);
 
 int roar_socket_listen_decnet (char * object, int num);
@@ -80,12 +80,12 @@
 int roar_socket_recv_fh (int sock,         char * mes, size_t * len);
 
-int roar_socket_open_socks4 (int mode, int fh, char * host, int port, char * user, char * pw, char * opts);
-int roar_socket_open_socks4a(int mode, int fh, char * host, int port, char * user, char * pw, char * opts);
-int roar_socket_open_socks4d(int mode, int fh, char * host, int port, char * user, char * pw, char * opts);
-int roar_socket_open_socks4x(int mode, int fh, char host[4], int port, char * app, size_t app_len, char * user);
+int roar_socket_open_socks4 (int mode, int fh, const char * host, int port, const char * user, const char * pw, const char * opts);
+int roar_socket_open_socks4a(int mode, int fh, const char * host, int port, const char * user, const char * pw, const char * opts);
+int roar_socket_open_socks4d(int mode, int fh, const char * host, int port, const char * user, const char * pw, const char * opts);
+int roar_socket_open_socks4x(int mode, int fh, char host[4], int port, const char * app, size_t app_len, const char * user);
 
-int roar_socket_open_http   (int mode, int fh, char * host, int port, char * user, char * pw, char * opts);
+int roar_socket_open_http   (int mode, int fh, const char * host, int port, const char * user, const char * pw, const char * opts);
 
-int roar_socket_open_ssh    (int mode, int fh, char * host, int port, char * user, char * pw, char * opts);
+int roar_socket_open_ssh    (int mode, int fh, const char * host, int port, const char * user, const char * pw, const char * opts);
 
 #endif
Index: include/libroar/vio.h
===================================================================
--- include/libroar/vio.h	(revision 5242)
+++ include/libroar/vio.h	(revision 5260)
@@ -87,6 +87,6 @@
 int     roar_vio_open_fh_socket(struct roar_vio_calls * calls, int fh) _LIBROAR_ATTR_NONNULL_ALL;
 
-int     roar_vio_open_socket   (struct roar_vio_calls * calls, char * host, int port) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL_ALL;
-int     roar_vio_open_socket_listen(struct roar_vio_calls * calls, int type, char * host, int port) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL_ALL;
+int     roar_vio_open_socket   (struct roar_vio_calls * calls, const char * host, int port) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL_ALL;
+int     roar_vio_open_socket_listen(struct roar_vio_calls * calls, int type, const char * host, int port) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL_ALL;
 
 int     roar_vio_simple_stream (struct roar_vio_calls * calls, int rate, int channels, int bits, int codec,
Index: libroar/socket.c
===================================================================
--- libroar/socket.c	(revision 5248)
+++ libroar/socket.c	(revision 5260)
@@ -383,9 +383,9 @@
 }
 
-int roar_socket_listen  (int type, char * host, int port) {
+int roar_socket_listen  (int type, const char * host, int port) {
  return roar_socket_open(MODE_LISTEN, type, host, port);
 }
 
-int roar_socket_connect (char * host, int port) {
+int roar_socket_connect (const char * host, int port) {
  char * proxy_type = getenv("ROAR_PROXY");
 
@@ -476,5 +476,5 @@
 }
 
-int roar_socket_open (int mode, int type, char * host, int port) {
+int roar_socket_open (int mode, int type, const char * host, int port) {
 // int type = ROAR_SOCKET_TYPE_INET;
  int fh;
@@ -520,4 +520,5 @@
 #ifdef ROAR_HAVE_LIBDNET
 #define _NEED_OBJ
+ char * dnet_node_buf;
 #endif
 #ifdef _NEED_OBJ
@@ -601,5 +602,11 @@
    // There is nothing wrong in this case to use dnet_conn() so we do.
    ROAR_DBG("roar_socket_open(*): CALL dnet_conn('%s', '%s', SOCK_STREAM, 0 ,0 ,0 , 0)", host, obj);
-   fh = dnet_conn(host, obj, SOCK_STREAM, 0 ,0 ,0 , 0);
+   dnet_node_buf = roar_mm_strdup(host);
+   if ( dnet_node_buf == NULL ) {
+    *del = ':';
+    return -1;
+   }
+   fh = dnet_conn(dnet_node_buf, obj, SOCK_STREAM, 0 ,0 ,0 , 0);
+   roar_mm_free(dnet_node_buf);
    ROAR_DBG("roar_socket_open(*): RET %i", fh);
    *del = ':';
@@ -812,5 +819,5 @@
 }
 
-int roar_socket_open_fork  (int mode, char * host, int port) {
+int roar_socket_open_fork  (int mode, const char * host, int port) {
 #if !defined(ROAR_TARGET_WIN32) && !defined(ROAR_TARGET_MICROCONTROLLER)
  char * daemonimage;
@@ -865,5 +872,5 @@
 }
 
-int roar_socket_open_file  (int mode, char * host, int port) {
+int roar_socket_open_file  (int mode, const char * host, int port) {
 #ifdef ROAR_HAVE_IO_POSIX
  int fh;
@@ -893,5 +900,5 @@
 
 #ifdef ROAR_SUPPORT_PROXY
-int roar_socket_open_proxy (int mode, int type, char * host, int port, char * proxy_type) {
+int roar_socket_open_proxy (int mode, int type, const char * host, int port, const char * proxy_type) {
  int    proxy_port = -1;
  char   proxy_host[ROAR_SOCKET_MAX_HOSTNAMELEN];
@@ -904,5 +911,5 @@
  char   proxy_addr_buf[1024];
  static struct passwd * passwd;
- int (* code)(int mode, int fh, char * host, int port, char * user, char * pw, char * opts) = NULL;
+ int (* code)(int mode, int fh, const char * host, int port, const char * user, const char * pw, const char * opts) = NULL;
 
  if ( passwd == NULL ) {
@@ -1020,5 +1027,5 @@
 // protocoll dependet proxy code:
 
-int roar_socket_open_socks4 (int mode, int fh, char * host, int port, char * user, char * pw, char * opts) {
+int roar_socket_open_socks4 (int mode, int fh, const char * host, int port, const char * user, const char * pw, const char * opts) {
 #ifndef ROAR_TARGET_MICROCONTROLLER
  struct hostent     * he;
@@ -1035,9 +1042,9 @@
 }
 
-int roar_socket_open_socks4a(int mode, int fh, char * host, int port, char * user, char * pw, char * opts) {
+int roar_socket_open_socks4a(int mode, int fh, const char * host, int port, const char * user, const char * pw, const char * opts) {
  return roar_socket_open_socks4x(mode, fh, "\0\0\0\1", port, host, strlen(host)+1, user);
 }
 
-int roar_socket_open_socks4d(int mode, int fh, char * host, int port, char * user, char * pw, char * opts) {
+int roar_socket_open_socks4d(int mode, int fh, const char * host, int port, const char * user, const char * pw, const char * opts) {
  size_t len = strlen(host)+1;
  char * dp;
@@ -1055,5 +1062,5 @@
 }
 
-int roar_socket_open_socks4x(int mode, int fh, char host[4], int port, char * app, size_t app_len, char * user) {
+int roar_socket_open_socks4x(int mode, int fh, char host[4], int port, const char * app, size_t app_len, const char * user) {
  char buf[9];
  int len;
@@ -1093,5 +1100,5 @@
 }
 
-int roar_socket_open_http   (int mode, int fh, char * host, int port, char * user, char * pw, char * opts) {
+int roar_socket_open_http   (int mode, int fh, const char * host, int port, const char * user, const char * pw, const char * opts) {
  char buf[1024];
  int len;
@@ -1126,5 +1133,5 @@
 
 #ifdef ROAR_HAVE_BIN_SSH
-int roar_socket_open_ssh    (int mode, int fh, char * host, int port, char * user, char * pw, char * opts) {
+int roar_socket_open_ssh    (int mode, int fh, const char * host, int port, const char * user, const char * pw, const char * opts) {
  char * proxy_addr = getenv("ssh_proxy");
  char * sep;
Index: libroar/vio.c
===================================================================
--- libroar/vio.c	(revision 5253)
+++ libroar/vio.c	(revision 5260)
@@ -357,5 +357,5 @@
 }
 
-int     roar_vio_open_socket   (struct roar_vio_calls * calls, char * host, int port) {
+int     roar_vio_open_socket   (struct roar_vio_calls * calls, const char * host, int port) {
  int fh;
 
@@ -371,5 +371,5 @@
 }
 
-int     roar_vio_open_socket_listen(struct roar_vio_calls * calls, int type, char * host, int port) {
+int     roar_vio_open_socket_listen(struct roar_vio_calls * calls, int type, const char * host, int port) {
  int fh;
 
