# SocketMC Class Reference

`#include <SocketMC.hh>`

Inheritance diagram for SocketMC:

[legend]

List of all members.

## Public Member Functions
| SocketMC ()
virtual | ~SocketMC ()
void | CreerSocketMC (char *addr, unsigned long port)
void | CreerSocketMC (unsigned long addr, unsigned long port)
virtual void | send (const unsigned char *, size_t) throw (NetworkError, NetworkSignal)
virtual void | receive (void *Buffer, unsigned long Size) throw (NetworkError, NetworkSignal)
virtual int | returnSocket ()
virtual unsigned long | returnAdress () const
virtual void | close ()
void | sendMC (NetworkMessage *msg)
char * | receiveMC (NetworkMessage *msg)
## Public Attributes
int | _socket_mc
bool | _est_init_mc
## Private Member Functions
int | timeoutMC (int, int)
| Wait for a socket event, until a time-out.
## Private Attributes
struct sockaddr_in | _sin
struct sockaddr_in | _sin_e
socklen_t | _sinlen
int | _socket_emetteur
int | _sinlen_e
int | _num_msg

## Detailed Description

Definition at line 45 of file SocketMC.hh.

## Constructor & Destructor Documentation

SocketMC | ( |  | ) |

Definition at line 40 of file SocketMC.cc.

References SocketMC::_est_init_mc, and SocketMC::_num_msg.

~SocketMC | ( |  | ) | `[virtual]`

Definition at line 50 of file SocketMC.cc.

References SocketMC::_est_init_mc, SocketMC::_socket_emetteur, SocketMC::_socket_mc, and SocketMC::close().

Here is the call graph for this function:

## Member Function Documentation

void CreerSocketMC | ( | char * | addr,
|  | unsigned long | port |
| ) |  |  |

Definition at line 73 of file SocketMC.cc.

Referenced by RTIG::processCreateFederation().

void CreerSocketMC | ( | unsigned long | addr,
|  | unsigned long | port |
| ) |  |  |

Definition at line 81 of file SocketMC.cc.

References SocketMC::_est_init_mc, SocketMC::_sin, SocketMC::_sin_e, SocketMC::_sinlen, SocketMC::_sinlen_e, SocketMC::_socket_emetteur, and SocketMC::_socket_mc.

void send | ( | const unsigned char * | Buffer,
|  | size_t |  |
| ) |  |  | throw (NetworkError, NetworkSignal)`[virtual]`

Implements Socket.

Definition at line 142 of file SocketMC.cc.

References SocketMC::sendMC().

Here is the call graph for this function:

void receive | ( | void * | Buffer,
|  | unsigned long | Size |
| ) |  |  | throw (NetworkError, NetworkSignal)`[virtual]`

Implements Socket.

Definition at line 151 of file SocketMC.cc.

References SocketMC::receiveMC().

Here is the call graph for this function:

int returnSocket | ( |  | ) | `[virtual]`

Implements Socket.

Definition at line 162 of file SocketMC.cc.

References SocketMC::_socket_mc.

unsigned long returnAdress | ( |  | ) | const`[virtual]`

Implements Socket.

Definition at line 167 of file SocketMC.cc.

References SocketMC::_sin_e.

Referenced by RTIG::processJoinFederation().

void close | ( |  | ) | `[virtual]`

Implements Socket.

Definition at line 174 of file SocketMC.cc.

References SocketMC::_est_init_mc, SocketMC::_socket_emetteur, and SocketMC::_socket_mc.

Referenced by SocketMC::~SocketMC().

void sendMC | ( | NetworkMessage * | msg | ) |

Definition at line 190 of file SocketMC.cc.

References SocketMC::_est_init_mc, SocketMC::_num_msg, SocketMC::_sin_e, SocketMC::_sinlen_e, SocketMC::_socket_emetteur, NetworkMessage::number, and TAILLE_MSG_RESEAU.

Referenced by SocketMC::send().

char * receiveMC | ( | NetworkMessage * | msg | ) |

Definition at line 210 of file SocketMC.cc.

References SocketMC::_est_init_mc, SocketMC::_sin, SocketMC::_sinlen, SocketMC::_socket_mc, and TAILLE_MSG_RESEAU.

Referenced by SocketMC::receive().

int timeoutMC | ( | int | sec,
|  | int | usec |
| ) |  |  | `[private]`

Wait for a socket event, until a time-out.

The time-out is given with seconds and microseconds in parameter.

Parameters:

  | sec | seconds
  | usec | microseconds

Returns:
  number of waiting events, 0 if time-out. May be negative in case of error

Definition at line 234 of file SocketMC.cc.

References SocketMC::_est_init_mc, and SocketMC::_socket_mc.

## Member Data Documentation

int _socket_mc

Definition at line 48 of file SocketMC.hh.

Referenced by SocketMC::close(), SocketMC::CreerSocketMC(), SocketMC::receiveMC(), SocketMC::returnSocket(), SocketMC::timeoutMC(), and SocketMC::~SocketMC().

bool _est_init_mc

Definition at line 49 of file SocketMC.hh.

Referenced by SocketMC::close(), SocketMC::CreerSocketMC(), SocketMC::receiveMC(), SocketMC::sendMC(), SocketMC::SocketMC(), SocketMC::timeoutMC(), and SocketMC::~SocketMC().

struct sockaddr_in _sin`[read, private]`

Definition at line 75 of file SocketMC.hh.

Referenced by SocketMC::CreerSocketMC(), and SocketMC::receiveMC().

struct sockaddr_in _sin_e`[read, private]`

Definition at line 76 of file SocketMC.hh.

Referenced by SocketMC::CreerSocketMC(), SocketMC::returnAdress(), and SocketMC::sendMC().

socklen_t _sinlen`[private]`

Definition at line 81 of file SocketMC.hh.

Referenced by SocketMC::CreerSocketMC(), and SocketMC::receiveMC().

int _socket_emetteur`[private]`

Definition at line 82 of file SocketMC.hh.

Referenced by SocketMC::close(), SocketMC::CreerSocketMC(), SocketMC::sendMC(), and SocketMC::~SocketMC().

int _sinlen_e`[private]`

Definition at line 84 of file SocketMC.hh.

Referenced by SocketMC::CreerSocketMC(), and SocketMC::sendMC().

int _num_msg`[private]`

Definition at line 88 of file SocketMC.hh.

Referenced by SocketMC::sendMC(), and SocketMC::SocketMC().

The documentation for this class was generated from the following files:

- SocketMC.hh
- SocketMC.cc