class Socket

This is basic class acting as TCP-IP Server

Inheritance:


Public Methods

[more] Socket()
Basic Constructor
[more]virtual ~Socket()
Virtual destructor
[more]bool create()
Initialize the server
[more]bool bind( const int port )
Bind the server to specified port
[more]bool listen() const
Create listen socket
[more]bool accept( Socket& ) const
Server accept the client socket
[more]bool connect( const std::string host, const int port )
Client initialization
[more]bool send( const std::string ) const
Sends data to TCP-IP client
[more]int recv( std::string& ) const
Receives the data from TCP-IP client


Documentation

This is basic class acting as TCP-IP Server
o Socket()
Basic Constructor

ovirtual ~Socket()
Virtual destructor

obool create()
Initialize the server
Returns:
boolean 'true' if server started successfully else 'false'

obool 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'

obool listen() const
Create listen socket
Returns:
boolean 'true' if server started successfully else 'false'

obool accept( Socket& ) const
Server accept the client socket
Returns:
boolean 'true' if server accepted the client successfully else 'false'

obool 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'

obool 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'

oint 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++.