No. And it's comfirmed by the error which isn't a bad permission, it's becouse of bad memory access.
I think that maybe when the library is compiled the compiler don't let the iosockinet memory space to the library an then it hasn't space enogh. I'll try with gcc3.
Any suggestion is greateful!
---------- Post updated at 11:41 AM ---------- Previous update was at 10:52 AM ----------
Compiling with gcc3 I got that error when make generates the binnary:
/usr/lib/libsocket++.so.1: undefined reference to `__cxa_get_exception_ptr@CXXABI_1.3.1'
After recompile socket++ with gcc3 the compilation error disappears but the segmentation fault persists and valgrind gives exactly the same message. It's not becouse of compiler, it must be an error using the library. But I don't find in official documentation that using socket++ with other libraries could create conflicts. Maybe it's a bad understanding concept about c++ and libraries but as far as I can see I'm using dynamic libraries correctly.
Please, any help will be really greateful!
---------- Post updated 08-12-09 at 06:06 AM ---------- Previous update was 08-11-09 at 11:41 AM ----------
Now I'm trying another way. My software has different command types and some of them needs read and write to the same socket. That's why I created a static class named connection which uses a C socket. That's the code:
connection.h:
#ifndef TAD_CONNECTION_H
#define TAD_CONNECTION_H
#include <netdb.h>
#include <sys/types.h> /* See NOTES */
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <iostream>
#include <unistd.h>
class connection {
private:
static int sock;
static struct sockaddr_in Direccion;
//static struct hostent *Host;
public:
int static make_connect();
int static send(const char* cmd);
int static recv(char *data, int len);
};
#endif
connection.cpp:
#include <iostream>
#include "connection.h"
using namespace std;
int connection::sock = -1;
struct sockaddr_in connection:

ireccion;
//struct hostent *connection::Host;
int connection::make_connect() {
//connection::Host = gethostbyname ("dissmar.es");
//cout << "Host: " << Host << endl;
if (sock == -1) {
sock = socket (AF_INET, SOCK_STREAM, 0);
cout << sock << endl;
Direccion.sin_family = AF_INET;
Direccion.sin_addr.s_addr = inet_addr( "127.0.0.1" );
//((struct in_addr*)(Host->h_addr))->s_addr;
Direccion.sin_port = 4442;
}
int i;
return i = connect(sock,(struct sockaddr*)&Direccion,sizeof(struct sockaddr));
}
int connection::send(const char* cmd){
int i = write(sock, cmd, strlen(cmd));
return i;
}
int connection::recv(char *data, int len){
return read(sock, data, len);
}
But it never connects and errno says that connection is refused. Server is running and other applications are making petitions on it.
Is it possible that a static member hasn't privileges enough to call connect? Or maybe a static member cannot call connect function becouse of other reasons? I've been looking in man pages and other official documentation and I couldn't find anything about conflicts between C socket and static members.
If I use the connection class on a separated main file connect fails too.
Thankyou so much again.
Daniel.
---------- Post updated at 11:25 AM ---------- Previous update was at 06:06 AM ----------
More information that I forgot:
connect() function sets errno with Connection refused but tcpdump don't show me any packet sent.
Any suggestions? I really need it! Thank you.