Developer Documentation
RAVL, Recognition And Vision Library
USER HOME PAGE CLASS LIST CONTENTS
Ravl - OS - Network - SocketBodyC
 

  PUBLIC
SocketBodyC::SocketBodyC(StringC,bool)
SocketBodyC::SocketBodyC(StringC,UIntT,bool)
SocketBodyC::SocketBodyC(struct sockaddr *,int,bool)
SocketBodyC::~SocketBodyC(void)
SocketBodyC::Fd(void) const
SocketBodyC::IsOpen(void) const
SocketBodyC::Listen(bool,int)
SocketBodyC::Close(void)
SocketBodyC::SetDontClose(bool)
SocketBodyC::ConnectedHost(void)
SocketBodyC::ConnectedPort(void)
SocketBodyC::GetHostByName(const char *,struct sockaddr_in &)
SocketBodyC::GetHostByAddr(struct sockaddr &,int,StringC &)
SocketBodyC::OpenSocket(struct sockaddr_in &,IntT)
SocketBodyC::OpenClient(const char *,IntT)
SocketBodyC::OpenServer(const char *,IntT)
RCBodyC::References(void) const
RCBodyC::Copy(void) const
RCBodyC::DeepCopy(UIntT) const
RCBodyC::IncRefCounter(void)
RCBodyC::DecRefCounter(void)

   SocketBodyC   
 
Socket connection body class.
 
include "Ravl/OS/Socket.hh"
Created:15/02/2000 
Source file:Ravl/OS/Network/Socket.hh
User Level:Develop
Library:RavlNet
Example:exSocket.cc
In Scope:RavlN

Comments:
For dealing with stream sockets.

Parent Classes: Variables:
int fd;

bool server;

struct sockaddr * addr;
Allocated as a char array.

bool dontClose;

Methods:
SocketBodyC(StringC name,bool server = false)
Open socket.

SocketBodyC(StringC name,UIntT portno,bool server = false)
Open socket.

SocketBodyC(struct sockaddr * addr,int nfd,bool server = false)
Open socket.

~SocketBodyC()
Open socket.

int Fd() const
Access file descriptor.

bool IsOpen() const
Test if socket is open.

SocketC Listen(bool block = true,int backLog = 1)
Listen for a connection from a client.
Can only be used on server sockets. If block is true, the call will not return until there is a valid client.

void Close()
Close the socket.

void SetDontClose(bool ndontClose)
Setup don't close flag.

StringC ConnectedHost()
Get host name

IntT ConnectedPort()
Get other port number.

bool GetHostByName(const char * name,struct sockaddr_in & sin)
Attempt to get info about named host.
returns true on success.

bool GetHostByAddr(struct sockaddr & sin,int sinLen,StringC & name)
Attempt to find hostname by the address.
returns true on success and assignes the hostname to name.

int OpenSocket(struct sockaddr_in & sin,IntT sockNo)
Open a socket to the given address / port no.

int OpenClient(const char * name,IntT sockNo)
Open a client socket.

int OpenServer(const char * name,IntT sockNo)
Open a server socket.
Its then ready for listening.

#include "Ravl/RefCounter.hh"
UIntT References() const
Access count of handles open to this object.

RCBodyC & Copy() const
Make copy of body.
This should be provided in derived classes. this funtion will issue an assertion failure if called.

RCBodyC & DeepCopy(UIntT levels = ((UIntT))) const
Make a deep copy of body.
This should be provided in derived classes. this funtion will issue an assertion failure if called.

void IncRefCounter()
Increment reference counter.

bool DecRefCounter()
Decrement reference counter.


Maintainer:Charles Galambos, Created: 15/02/2000, Documentation by CxxDoc: Tue Aug 13 09:59:30 2002