This is done for better merging branch/LG_PRE_RELEASE_0.3 into trunk (same process is applied on this branch) git-svn-id: http://svn.eurecom.fr/openair4G/trunk@7073 818b1a75-f10b-46b9-bf7c-635c3b92a50f
36 lines
774 B
C++
36 lines
774 B
C++
#include <string>
|
|
|
|
//defines structs for socket handling
|
|
#include <netinet/in.h>
|
|
|
|
|
|
using namespace std;
|
|
|
|
typedef struct sockaddr_in SockAddrStruct;
|
|
typedef struct hostent HostInfoStruct;
|
|
|
|
class TcpClient
|
|
{
|
|
public:
|
|
TcpClient();
|
|
~TcpClient();
|
|
|
|
void connectToServer( string &hostname, int port );
|
|
void disconnect( );
|
|
void transmit( string &txString );
|
|
void receive( string &rxString );
|
|
|
|
string getCurrentHostName( ) const;
|
|
int getCurrentPort( ) const;
|
|
|
|
private:
|
|
string currentHostName;
|
|
int currentPort;
|
|
int currentSocketDescr;
|
|
SockAddrStruct serverAddress;
|
|
HostInfoStruct * currentHostInfo;
|
|
bool clientIsConnected;
|
|
|
|
int receiveBufferSize;
|
|
};
|