Accueil > > > LIBRAIRIE POUR SOCKETS C++
LIBRAIRIE POUR SOCKETS C++
Information sur la source
Description
Voici une source permettant de créer des clients et des serveurs basées sur les sockets pour système UNIX.
Pour cela il suffit d'implémenter la méthode virtuelle interaction.
La partie connexion est gérée automatiquement. Chaque connexion d'un client est gérée par un thead.
note : ne fonctionne pas sous windows.
La source contient un exemple d'implémentation d'un client et d'un serveur.
Le serveur cle/valeur implémente les operations suivantes:
- GET CLE
- PUT CLE VALEUR
- DEL CLE
- QUIT
Les applications doivent être lancées à partir du terminal :
serveur : ./server-word-word 23000
client : ./client-word-word localhost 23000
telecharger source : http://www.megaupload.com/?d=VKWF64L6
Source
- #ifndef _SOCKET_HH_
- #define _SOCKET_HH_
-
- #include "libsocketException.h"
-
- extern "C"
- {
- #include <stdlib.h>
- #include <stdio.h>
- };
-
- #include <iostream>
- #include <sstream>
-
- namespace libsocket
- {
- /*____________________________________________________________________________________________*/
- /**
- * une socket.
- **/
- class Socket
- {
- protected:
- int _fd;// descripteur de la socket
- virtual void socket() = 0;
- virtual void bind(int port) = 0;
-
- public:
- Socket();
- virtual void close()=0;
- void setFd(int fd);
- int getFd();
- };
- }
-
- #endif
-
- #include "libsocketTcp.h"
-
- extern "C"
- {
- #include <sys/types.h>
- #include <sys/socket.h>
- #include <netdb.h>
- #include <errno.h>
- #include <netinet/in.h>
- #include <string.h>
- };
-
- #include <iostream>
- #include <sstream>
- #include <pthread.h> // librairie thread
-
- namespace libsocket
- {
- /*************************************************************************/
- /** Server **/
- /*************************************************************************/
- /*_____________________________________________________________________________*/
- /**
-
- **/
- void ServerTcp::run(int port)
- {
- socket();
- bind(port);
- listen(10);
- loop();
- }
-
- /*_____________________________________________________________________________*/
- /**
- * boucle d'intéraction
- **/
- void ServerTcp::loop()
- {
- /*while (true)
- {
- SocketTcp client;
- accept(client);
- std::cout<<"apres:"<<client.getFd()<<std::endl;
-
- if(fork() == 0)
- {
- printf("connexion \n");
- interaction(client);
- client.close();
- printf("deconnexion \n");
- exit(0);
- }
- }*/
-
- while (true)
- {
- SocketTcp* client = new SocketTcp();
- accept(*client);
-
- pthread_t num_thread[1];
-
- void * tab[2] = {this,client};
-
- if (pthread_create(&num_thread[0], NULL, (void *(*)(void *))&ServerTcp::startThread,tab) == -1)
- perror ("problème creation du thread\n");
- }
- }
-
- /*_____________________________________________________________________________*/
- /**
- * on est obligé de passer par une métode static pour utiliser un thread
- **/
- void* ServerTcp::startThread ( void* Parameters[] )
- {
- ServerTcp* server = reinterpret_cast<ServerTcp*>(Parameters[0]);//recupere l'objet Server
- SocketTcp* client = reinterpret_cast<SocketTcp*>(Parameters[1]);//recupere la socket client
- server->runThread(client);
- }
-
- /*_____________________________________________________________________________*/
- /**
- * methode appelé par le thread
- **/
- void ServerTcp::runThread(SocketTcp* client)
- {
- printf("connexion\n");
-
- interaction(*client);//appel de la methode virtuelle interaction
- client->close();//fermeture de la socket
- delete client;//liberation du pointeur client déclaré dans Server::loop
-
- printf("deconnexion \n");
- pthread_exit(NULL);//detruit le thread
- }
-
- /*************************************************************************/
- /** Client **/
- /*************************************************************************/
-
- /*_____________________________________________________________________________*/
- /**
- * utilise les méthodes de Socket pour établir une connexion
- * à une serveur lancer l'interaction
- **/
- void ClientTcp::run(const char* host, int port)
- {
- socket();
- connect(host,port);
- interaction();
- close();
- }
-
- /*_____________________________________________________________________________*/
- /**
- * cette variante appelle la précédente
- **/
- void ClientTcp::run(string& host, int port)
- {
- run(host.c_str(),port);
- }
-
- };
-
- #include "socketTcp.h"
- #include <iostream>
- using namespace std;
-
- namespace libsocket
- {
- /*_____________________________________________________________________________*/
- /**
- * invoque l'appel système socket
- **/
- void SocketTcp::socket()
- {
- _fd = ::socket(PF_INET, SOCK_STREAM, 0); // appel la fonction socket de c.
- if (_fd < 0) throw ErrnoExcept("socket");
- }
-
- /*_____________________________________________________________________________*/
- void SocketTcp::connect(const char* host, int port)
- {
- ostringstream os;
- os<<port;
-
- socket();
- struct addrinfo *serv_addr = 0;
- int k = getaddrinfo(host,os.str().c_str(),0,&serv_addr);//obtebir une structure d adresse
- if(k != 0)
- throw ErrnoExcept("getaddrinfo");
-
- while(k=::connect(_fd,serv_addr->ai_addr,serv_addr->ai_addrlen))
- {
- if(k<0)
- if (errno==EAGAIN || errno==EINTR) continue;
- else
- throw ErrnoExcept("serveur indisponible");
- }
-
- freeaddrinfo(serv_addr);
- }
-
-
-
- /*_____________________________________________________________________________*/
- /**
- * ferme la socket
- **/
- void SocketTcp::close()
- {
- while (_fd >= 0)
- {
- int r = ::close(_fd);
- if (r < 0)
- {
- if (errno == EINTR) continue;
- else throw ErrnoExcept("close");
- }
- break;
- }
- _fd = -1;
- }
-
- /*_____________________________________________________________________________*/
- /**
- * lie la socket au port sur toutes les interfaces.
- **/
- void SocketTcp::bind(int port)
- {
- struct sockaddr_in addr;
- addr.sin_family = AF_INET;
- addr.sin_port = htons(port);
- addr.sin_addr.s_addr = htonl(INADDR_ANY);
-
- if (::bind(_fd, (struct sockaddr *) &addr, sizeof(addr))==-1)
- throw ErrnoExcept("bind");
- }
-
- /*_____________________________________________________________________________*/
- /**
- * \c listen pour indiquer qu'on va écouter sur cette socket.
- **/
- void SocketTcp::listen(int backlog)
- {
- if (::listen(_fd, backlog)==-1)
- throw ErrnoExcept("listen");
- }
-
- /*_____________________________________________________________________________*/
- /**
- * Pour attendre et accepter une demande de connexion d'un client. C
- **/
- void SocketTcp::accept(Socket& client)
- {
- while (true)
- {
- int cli = ::accept(_fd, NULL, NULL);
- if (cli < 0)
- {
- //cas exceptionnels de fonctionnement normal
- if (errno == EAGAIN || errno == EWOULDBLOCK || errno == EINTR) continue;
- else throw ErrnoExcept("accept");
- }
-
- client.setFd(cli);
- break;
- }
- }
-
- /*_____________________________________________________________________________*/
- /**
- * écrit sur la socket exactement n octets pointés par buf.
- **/
- void SocketTcp::write(const char* buf, int n)
- {
- while (n > 0)
- {
- int k = ::write(_fd, buf, n);
- if (k < 0)
- {
- if (errno == EAGAIN || errno == EINTR) continue;
- else throw ErrnoExcept("write");
- }
- buf += k;
- n -= k;
- }
- }
-
- /*_____________________________________________________________________________*/
- /**
- * ecrit sur la socket en calculant elle-même la
- * longueur de la chaîne de caractères.
- **/
- void SocketTcp::write(const char* buf)
- {
- write(buf, strlen(buf)+1);//+1 pour compter le '\0'
- }
-
- /*_____________________________________________________________________________*/
- /**
- /**
- * Pour attendre et accepter une demande de connexion d'un client.
- **/
- void SocketTcp::write(const string& buf)
- {
- write(buf.c_str(), buf.length()+1);//+1 pour compter le '\0'
- }
-
- /*_____________________________________________________________________________*/
- void SocketTcp::read(char *buf,int n)
- {
- while (n > 0)
- {
- int k = ::read(_fd, buf, n);
- if (k < 0)
- if (errno == EAGAIN || errno == EINTR) continue;
- else throw ErrnoExcept("read");
-
- buf += k;
- n -= k;
- }
- }
-
- /*_____________________________________________________________________________*/
- /**
- * lit sur la socket exactement n octets et les retourne sous
- la forme d'un string. (ne pas compter le caractère de fin de chaine '\0')
- **/
- string SocketTcp::read(int n)
- {
- char mes[n+1]; //a corriger !!
- read(mes,n);
-
- int taille = strlen(mes);
-
- if(mes[taille] != '\0')
- mes[taille+1] = '\0';
-
- return (string) mes;
- }
-
- /*_____________________________________________________________________________*/
- /**
- * lire un entier
- **/
- int32_t SocketTcp::readInt32()
- {
- int32_t v;
- read((char *) &v,sizeof(v));
-
- return ntohl(v);
- }
-
- /*_____________________________________________________________________________*/
- /**
- * ecrire un entier
- **/
- void SocketTcp::writeInt32(int i)
- {
- int32_t v = htonl(i);
- write (( const char *) &v,sizeof(v));
- }
-
- /*_____________________________________________________________________________*/
- /**
- * lit une ligne de texte et retourne un string (sans le \n)
- **/
- string SocketTcp::readLine()
- {
- char c;
- ostringstream os;
-
- while(true)
- {
- int k = ::read(_fd,&c,1);
- if (k <= 0)//si k==0 on leve une exception pour eviter une boucle infinie
- if (errno == EAGAIN || errno == EINTR) continue;
- else throw ErrnoExcept("readline");
-
- if(c == EOF || c == '\0' || c == '\n') break;
- else os << c;
- }
-
- return os.str();
- }
-
- /*_____________________________________________________________________________*/
- /**
- * lit un mot délimité par un espaces.
- **/
- string SocketTcp::readWord()
- {
- char c;
- ostringstream res ;
- int k;
-
- //supprime les espaces
- while(true)
- {
- k = ::read(_fd,&c,1);
- if (k <= 0) //si k==0 on leve une exception pour eviter une boucle infinie
- if (errno == EAGAIN || errno == EINTR) continue;
- else throw ErrnoExcept("readword");
-
- if(c == EOF || c == '\n' || c == '\0') return "";
- if(!isspace(c))
- {
- res<<c;
- break;
- }
- }
-
- //lecture d'un mot
- while(true)
- {
- k= ::read(_fd,&c,1);
- if (k <= 0)
- if (errno == EAGAIN || errno == EINTR) continue;
- else throw ErrnoExcept("readword");
-
- if(c == EOF || c == '\0' || c == '\n' || isspace(c)) break;
- else
- res << c;
- }
-
- return res.str();
- }
-
- }
-
- #include "socketUdp.h"
- #include <iostream>
- using namespace std;
-
- namespace libsocket
- {
-
- /*_____________________________________________________________________________*/
- /**
- * invoque l'appel système socket
- **/
- void SocketUdp::socket()
- {
- _fd = ::socket(AF_INET, SOCK_DGRAM, 0); // appel la fonction socket de c.
- if (_fd < 0) throw ErrnoExcept("socket");
- }
-
- /*_____________________________________________________________________________*/
- /**
- * ferme la socket
- **/
- void SocketUdp::close()
- {
- while (_fd >= 0)
- {
- int r = ::close(_fd);
- if (r < 0)
- {
- if (errno == EINTR) continue;
- else throw ErrnoExcept("close");
- }
- break;
- }
- _fd = -1;
- }
-
- /*_____________________________________________________________________________*/
- /**
- * lie la socket au port sur toutes les interfaces.
- **/
- void SocketUdp::bind(int port)
- {
- this->addr.sin_family = AF_INET;
- this->addr.sin_port = htons(port);
- this->addr.sin_addr.s_addr = htonl(INADDR_ANY);
-
- if (::bind(this->_fd, (struct sockaddr *) &this->addr, sizeof(this->addr))!=0)
- throw ErrnoExcept("bind");
- }
-
- /*_____________________________________________________________________________*/
- /**
- * envoyer un message.
- **/
- void SocketUdp::sendto(const char* mes)
- {
- ::sendto(this->getFd(),mes,strlen(mes)+1,0,(struct sockaddr*)&this->addr,sizeof(addr));
- }
-
- /*_____________________________________________________________________________*/
- /**
- * envoyer un message.
- **/
- void SocketUdp::sendto(string mes)
- {
- sendto(mes.c_str());
- }
-
- /*_____________________________________________________________________________*/
- /**
- * recevoir un message.
- **/
- string SocketUdp::recvfrom(int n)
- {
- char mes[n+1];
-
- int flag = ::recvfrom(this->getFd(),mes,n,0,(struct sockaddr*)&this->addr,&this->lg_app);
-
- int taille = strlen(mes);
- if(mes[taille] != '\0')
- mes[taille+1] = '\0';
-
- return (string) mes;
- }
-
- }
#ifndef _SOCKET_HH_
#define _SOCKET_HH_
#include "libsocketException.h"
extern "C"
{
#include <stdlib.h>
#include <stdio.h>
};
#include <iostream>
#include <sstream>
namespace libsocket
{
/*____________________________________________________________________________________________*/
/**
* une socket.
**/
class Socket
{
protected:
int _fd;// descripteur de la socket
virtual void socket() = 0;
virtual void bind(int port) = 0;
public:
Socket();
virtual void close()=0;
void setFd(int fd);
int getFd();
};
}
#endif
#include "libsocketTcp.h"
extern "C"
{
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <errno.h>
#include <netinet/in.h>
#include <string.h>
};
#include <iostream>
#include <sstream>
#include <pthread.h> // librairie thread
namespace libsocket
{
/*************************************************************************/
/** Server **/
/*************************************************************************/
/*_____________________________________________________________________________*/
/**
**/
void ServerTcp::run(int port)
{
socket();
bind(port);
listen(10);
loop();
}
/*_____________________________________________________________________________*/
/**
* boucle d'intéraction
**/
void ServerTcp::loop()
{
/*while (true)
{
SocketTcp client;
accept(client);
std::cout<<"apres:"<<client.getFd()<<std::endl;
if(fork() == 0)
{
printf("connexion \n");
interaction(client);
client.close();
printf("deconnexion \n");
exit(0);
}
}*/
while (true)
{
SocketTcp* client = new SocketTcp();
accept(*client);
pthread_t num_thread[1];
void * tab[2] = {this,client};
if (pthread_create(&num_thread[0], NULL, (void *(*)(void *))&ServerTcp::startThread,tab) == -1)
perror ("problème creation du thread\n");
}
}
/*_____________________________________________________________________________*/
/**
* on est obligé de passer par une métode static pour utiliser un thread
**/
void* ServerTcp::startThread ( void* Parameters[] )
{
ServerTcp* server = reinterpret_cast<ServerTcp*>(Parameters[0]);//recupere l'objet Server
SocketTcp* client = reinterpret_cast<SocketTcp*>(Parameters[1]);//recupere la socket client
server->runThread(client);
}
/*_____________________________________________________________________________*/
/**
* methode appelé par le thread
**/
void ServerTcp::runThread(SocketTcp* client)
{
printf("connexion\n");
interaction(*client);//appel de la methode virtuelle interaction
client->close();//fermeture de la socket
delete client;//liberation du pointeur client déclaré dans Server::loop
printf("deconnexion \n");
pthread_exit(NULL);//detruit le thread
}
/*************************************************************************/
/** Client **/
/*************************************************************************/
/*_____________________________________________________________________________*/
/**
* utilise les méthodes de Socket pour établir une connexion
* à une serveur lancer l'interaction
**/
void ClientTcp::run(const char* host, int port)
{
socket();
connect(host,port);
interaction();
close();
}
/*_____________________________________________________________________________*/
/**
* cette variante appelle la précédente
**/
void ClientTcp::run(string& host, int port)
{
run(host.c_str(),port);
}
};
#include "socketTcp.h"
#include <iostream>
using namespace std;
namespace libsocket
{
/*_____________________________________________________________________________*/
/**
* invoque l'appel système socket
**/
void SocketTcp::socket()
{
_fd = ::socket(PF_INET, SOCK_STREAM, 0); // appel la fonction socket de c.
if (_fd < 0) throw ErrnoExcept("socket");
}
/*_____________________________________________________________________________*/
void SocketTcp::connect(const char* host, int port)
{
ostringstream os;
os<<port;
socket();
struct addrinfo *serv_addr = 0;
int k = getaddrinfo(host,os.str().c_str(),0,&serv_addr);//obtebir une structure d adresse
if(k != 0)
throw ErrnoExcept("getaddrinfo");
while(k=::connect(_fd,serv_addr->ai_addr,serv_addr->ai_addrlen))
{
if(k<0)
if (errno==EAGAIN || errno==EINTR) continue;
else
throw ErrnoExcept("serveur indisponible");
}
freeaddrinfo(serv_addr);
}
/*_____________________________________________________________________________*/
/**
* ferme la socket
**/
void SocketTcp::close()
{
while (_fd >= 0)
{
int r = ::close(_fd);
if (r < 0)
{
if (errno == EINTR) continue;
else throw ErrnoExcept("close");
}
break;
}
_fd = -1;
}
/*_____________________________________________________________________________*/
/**
* lie la socket au port sur toutes les interfaces.
**/
void SocketTcp::bind(int port)
{
struct sockaddr_in addr;
addr.sin_family = AF_INET;
addr.sin_port = htons(port);
addr.sin_addr.s_addr = htonl(INADDR_ANY);
if (::bind(_fd, (struct sockaddr *) &addr, sizeof(addr))==-1)
throw ErrnoExcept("bind");
}
/*_____________________________________________________________________________*/
/**
* \c listen pour indiquer qu'on va écouter sur cette socket.
**/
void SocketTcp::listen(int backlog)
{
if (::listen(_fd, backlog)==-1)
throw ErrnoExcept("listen");
}
/*_____________________________________________________________________________*/
/**
* Pour attendre et accepter une demande de connexion d'un client. C
**/
void SocketTcp::accept(Socket& client)
{
while (true)
{
int cli = ::accept(_fd, NULL, NULL);
if (cli < 0)
{
//cas exceptionnels de fonctionnement normal
if (errno == EAGAIN || errno == EWOULDBLOCK || errno == EINTR) continue;
else throw ErrnoExcept("accept");
}
client.setFd(cli);
break;
}
}
/*_____________________________________________________________________________*/
/**
* écrit sur la socket exactement n octets pointés par buf.
**/
void SocketTcp::write(const char* buf, int n)
{
while (n > 0)
{
int k = ::write(_fd, buf, n);
if (k < 0)
{
if (errno == EAGAIN || errno == EINTR) continue;
else throw ErrnoExcept("write");
}
buf += k;
n -= k;
}
}
/*_____________________________________________________________________________*/
/**
* ecrit sur la socket en calculant elle-même la
* longueur de la chaîne de caractères.
**/
void SocketTcp::write(const char* buf)
{
write(buf, strlen(buf)+1);//+1 pour compter le '\0'
}
/*_____________________________________________________________________________*/
/**
/**
* Pour attendre et accepter une demande de connexion d'un client.
**/
void SocketTcp::write(const string& buf)
{
write(buf.c_str(), buf.length()+1);//+1 pour compter le '\0'
}
/*_____________________________________________________________________________*/
void SocketTcp::read(char *buf,int n)
{
while (n > 0)
{
int k = ::read(_fd, buf, n);
if (k < 0)
if (errno == EAGAIN || errno == EINTR) continue;
else throw ErrnoExcept("read");
buf += k;
n -= k;
}
}
/*_____________________________________________________________________________*/
/**
* lit sur la socket exactement n octets et les retourne sous
la forme d'un string. (ne pas compter le caractère de fin de chaine '\0')
**/
string SocketTcp::read(int n)
{
char mes[n+1]; //a corriger !!
read(mes,n);
int taille = strlen(mes);
if(mes[taille] != '\0')
mes[taille+1] = '\0';
return (string) mes;
}
/*_____________________________________________________________________________*/
/**
* lire un entier
**/
int32_t SocketTcp::readInt32()
{
int32_t v;
read((char *) &v,sizeof(v));
return ntohl(v);
}
/*_____________________________________________________________________________*/
/**
* ecrire un entier
**/
void SocketTcp::writeInt32(int i)
{
int32_t v = htonl(i);
write (( const char *) &v,sizeof(v));
}
/*_____________________________________________________________________________*/
/**
* lit une ligne de texte et retourne un string (sans le \n)
**/
string SocketTcp::readLine()
{
char c;
ostringstream os;
while(true)
{
int k = ::read(_fd,&c,1);
if (k <= 0)//si k==0 on leve une exception pour eviter une boucle infinie
if (errno == EAGAIN || errno == EINTR) continue;
else throw ErrnoExcept("readline");
if(c == EOF || c == '\0' || c == '\n') break;
else os << c;
}
return os.str();
}
/*_____________________________________________________________________________*/
/**
* lit un mot délimité par un espaces.
**/
string SocketTcp::readWord()
{
char c;
ostringstream res ;
int k;
//supprime les espaces
while(true)
{
k = ::read(_fd,&c,1);
if (k <= 0) //si k==0 on leve une exception pour eviter une boucle infinie
if (errno == EAGAIN || errno == EINTR) continue;
else throw ErrnoExcept("readword");
if(c == EOF || c == '\n' || c == '\0') return "";
if(!isspace(c))
{
res<<c;
break;
}
}
//lecture d'un mot
while(true)
{
k= ::read(_fd,&c,1);
if (k <= 0)
if (errno == EAGAIN || errno == EINTR) continue;
else throw ErrnoExcept("readword");
if(c == EOF || c == '\0' || c == '\n' || isspace(c)) break;
else
res << c;
}
return res.str();
}
}
#include "socketUdp.h"
#include <iostream>
using namespace std;
namespace libsocket
{
/*_____________________________________________________________________________*/
/**
* invoque l'appel système socket
**/
void SocketUdp::socket()
{
_fd = ::socket(AF_INET, SOCK_DGRAM, 0); // appel la fonction socket de c.
if (_fd < 0) throw ErrnoExcept("socket");
}
/*_____________________________________________________________________________*/
/**
* ferme la socket
**/
void SocketUdp::close()
{
while (_fd >= 0)
{
int r = ::close(_fd);
if (r < 0)
{
if (errno == EINTR) continue;
else throw ErrnoExcept("close");
}
break;
}
_fd = -1;
}
/*_____________________________________________________________________________*/
/**
* lie la socket au port sur toutes les interfaces.
**/
void SocketUdp::bind(int port)
{
this->addr.sin_family = AF_INET;
this->addr.sin_port = htons(port);
this->addr.sin_addr.s_addr = htonl(INADDR_ANY);
if (::bind(this->_fd, (struct sockaddr *) &this->addr, sizeof(this->addr))!=0)
throw ErrnoExcept("bind");
}
/*_____________________________________________________________________________*/
/**
* envoyer un message.
**/
void SocketUdp::sendto(const char* mes)
{
::sendto(this->getFd(),mes,strlen(mes)+1,0,(struct sockaddr*)&this->addr,sizeof(addr));
}
/*_____________________________________________________________________________*/
/**
* envoyer un message.
**/
void SocketUdp::sendto(string mes)
{
sendto(mes.c_str());
}
/*_____________________________________________________________________________*/
/**
* recevoir un message.
**/
string SocketUdp::recvfrom(int n)
{
char mes[n+1];
int flag = ::recvfrom(this->getFd(),mes,n,0,(struct sockaddr*)&this->addr,&this->lg_app);
int taille = strlen(mes);
if(mes[taille] != '\0')
mes[taille+1] = '\0';
return (string) mes;
}
}
Historique
- 29 mai 2010 20:33:47 :
- ajout lien zip
- 05 juin 2010 22:35:48 :
- ajout socket udp
Sources de la même categorie
Commentaires et avis
Discussions en rapport avec ce code source dans le forum
Socket [ par edpunisher ]
kikoo, j ai un projet oû je doit utiliser les socket entre une machine windows et une autre unix sauf que j ai tt asseyer mais rien ne marche, le
Socket entre machine windows et unix [ par edpunisher ]
kikoo, j ai un projet oû je doit utiliser les socket entre une machine windows et une autre unix sauf que j ai tt asseyer mais rien ne marche, le
client ftp soux unix [ par eilyn ]
salutvoila je voudrais faire un client ftp sous unixdonc pour créer ma socket j'utilise la méthodeSOCKET s;s = socket (AF_INET,SOCK_STREAM,"protocol")
socket AF_UNIX [ par hobbes ]
Bonjour,Je cherche les sources de l'utilisation des sockets avec AF_UNIX.QQ peut il m aider???Bonne programmation.
socket unix locale [ par gaussdelphine ]
je souhaite faire un envoi de socket unix de domaine AF_UNIX avec la même adresse pour le client et le serveur.Est ce que c'est possible??J'obtiens un
IP_HDRINCL socket Raw [ par gaussdelphine ]
Je voudrais utiliser la primitive: setsockopt pour fixer l'optionIP_HDRINCL à 1. Le problème c'est que j'utilise cygwin qui d'après ce que j'ai lu sur
Thread et socket udp [ par eurysthe ]
Bonjour !!Voila j'ai un petit problème de thread qui me pourrit la vie.J'ai crée un thread qui doit écouter en boucle les informations qui transite su
socket [ par gaussdelphine ]
J'essaye de programmer une socket em mode datagramme SOCK_RAW. J'ai le message d'erreur suivant à la compilation:sizeof applied to an incomplete type
Connexion/Deconnexion/Reconnexion Socket [ par tequila1 ]
BonjourJ'ai développé une DLL, qui se connecte à un serveur de données via socket.J'utilise pour cela les MFC. Je me connecte au serveur, je recois le
socket + IE6 - aide svp [ par jrecan ]
bonjour, je voudrais créer un proxy sous winXPpour cela, je dois récupérer l'adresse url que je tape dans IE6.Dans un premier temps, j aimerais faire
|
Derniers Blogs
IMAGINE CUP 2012, MAKE A SIGN EN FINALEIMAGINE CUP 2012, MAKE A SIGN EN FINALE par junarnoalg
Voilà qui est fait, la nouvelle est officielle ! L'équipe belge "Make a Sign" va au pays des kangourous défendre son projet dans la catégorie Software Design. http://www.imaginecup.com/CompetitionsContent/Competition/WorldwideFinalists.aspx V...
Cliquez pour lire la suite de l'article par junarnoalg KINECT 1.5 IS OUT !KINECT 1.5 IS OUT ! par Vko
La version 1.5 du Kinect For Microsoft vient tout juste de sortir ! Plein de nouveautés: Tracking de squelette en Near Mode Détection en position assise Détection faciale avec un SDK dédié Documentation et des guideline (enfin) Un out...
Cliquez pour lire la suite de l'article par Vko LES ACTUALITéS DE LA SEMAINE SUR C2I.FR (14 MAI - 20 MAI) LES ACTUALITéS DE LA SEMAINE SUR C2I.FR (14 MAI - 20 MAI) par richardc
Mise à jour des Web API du 14 Mai
Réservez dès maintenant votre journée du 20 juin pour le Windows Azure Dev Camp 2012 à Paris
Mise à jour de Team Foundation Service
MechCommander 2 sur Windows 8
Entity Framework 5 Release Candidate e...
Cliquez pour lire la suite de l'article par richardc REACTIVE EXTENSIONS : CONSOMMER DES SERVICES AVEC RX PARTIE 3, LES PIèGES à éVITERREACTIVE EXTENSIONS : CONSOMMER DES SERVICES AVEC RX PARTIE 3, LES PIèGES à éVITER par Groc
Une mauvaise utilisation de rx lors de l'écriture d'une couche d'accès à des services peut conduire à des cas embarassants avec des erreurs mal gérées, des appels qui ne partent lorsqu'ils le devraient, et même des résultats incorrects . le tout nuis...
Cliquez pour lire la suite de l'article par Groc SHAREPOINT BLOG SITE, PROBLèME D'ARCHIVESSHAREPOINT BLOG SITE, PROBLèME D'ARCHIVES par junarnoalg
Dernièrement, nous avons migré le site
myTIC
vers un nouveau serveur SharePoint 2010. Dans les contenus que nous vouloins récupérer, nous avions un certain nombre de blogs.
Nous avons utilisé les commandes Power...
Cliquez pour lire la suite de l'article par junarnoalg
Forum
RE : SAC A DOS RE : SAC A DOS par hadjkaddour
Cliquez pour lire la suite par hadjkaddour
Logiciels
sDEVIS-FACTURES vlPRO (8.1.0.3)SDEVIS-FACTURES VLPRO (8.1.0.3)sDEVIS-FACTURES vlPRO a été mis au point pour les particuliers, créateurs, entrepreneurs, artisa... Cliquez pour télécharger sDEVIS-FACTURES vlPRO 974 Application Server (12.2.4.6)974 APPLICATION SERVER (12.2.4.6)Développez de puissantes applications dans un environnement de 'cloud computing', clusterisé, séc... Cliquez pour télécharger 974 Application Server vPicture (1.4.2.1)VPICTURE (1.4.2.1)Avec vPicture, hébergez vos images facilement et rapidement.
vPicture est un utilitaire simple, ... Cliquez pour télécharger vPicture Easy-Planning (2.2.1.6)EASY-PLANNING (2.2.1.6)Easy-Planning permet de créer des plannings sous la représentation de diagrammes et est adapté au... Cliquez pour télécharger Easy-Planning COM-BACKUP (2.0)COM-BACKUP (2.0)
COM-BACKUP est un logiciel de sauvegarde qui permet de planifier les sauvegardes de vos dossiers ...
Cliquez pour télécharger COM-BACKUP
|