This is basic class acting as TCP-IP Server
Inheritance:
Public Methods
-
Socket()
- Basic Constructor
-
virtual ~Socket()
- Virtual destructor
-
bool create()
- Initialize the server
-
bool bind( const int port )
- Bind the server to specified port
-
bool listen() const
- Create listen socket
-
bool accept( Socket& ) const
- Server accept the client socket
-
bool connect( const std::string host, const int port )
- Client initialization
-
bool send( const std::string ) const
- Sends data to TCP-IP client
-
int recv( std::string& ) const
- Receives the data from TCP-IP client
Documentation
This is basic class acting as TCP-IP Server
Socket()
-
Basic Constructor
virtual ~Socket()
-
Virtual destructor
bool create()
-
Initialize the server
- Returns:
- boolean 'true' if server started successfully else 'false'
bool bind( const int port )
-
Bind the server to specified port
- Parameters:
- port - integer value of port no
- Returns:
- boolean 'true' if server is binded successfully to the given port else 'false'
bool listen() const
-
Create listen socket
- Returns:
- boolean 'true' if server started successfully else 'false'
bool accept( Socket& ) const
-
Server accept the client socket
- Returns:
- boolean 'true' if server accepted the client successfully else 'false'
bool connect( const std::string host, const int port )
-
Client initialization
- Parameters:
- host - String Value of host ip address
port - Integer Value of host port no
- Returns:
- boolean 'true' if client connects the server successfully else 'false'
bool send( const std::string ) const
-
Sends data to TCP-IP client
- Parameters:
- String - Value of data
- Returns:
- boolean 'true' if data sending is successfull else 'false'
int recv( std::string& ) const
-
Receives the data from TCP-IP client
- Parameters:
- String - Value of data
- This class has no child classes.
- Author:
- Parikshit Thakur & Team, Trace R&D Center
- Version:
- Revision: 1.0
Alphabetic index HTML hierarchy of classes or Java
This page was generated with the help of DOC++.