Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

Connection Class Reference

#include <Connection.h>

List of all members.

Public Member Functions

 Connection (int port)
virtual ~Connection ()
ConnectionwaitForConnection ()
int connectByIp (char *addr)
int disconnect ()
int recieveData (char *buf, int size, int flag)
int sendData (char *buf, int size)
int getLastError ()
int getPort ()

Private Member Functions

 Connection (SOCKET s)

Private Attributes

SOCKET tcp
SOCKET ls
int port
sockaddr_in sin
bool isConnected
bool isOpen


Detailed Description

Definition at line 7 of file Connection.h.


Constructor & Destructor Documentation

Connection::Connection SOCKET  s  )  [private]
 

Definition at line 23 of file Connection.cpp.

References isConnected, isOpen, port, and tcp.

Referenced by waitForConnection().

Connection::Connection int  port  ) 
 

Definition at line 3 of file Connection.cpp.

References isConnected, isOpen, and tcp.

virtual Connection::~Connection  )  [inline, virtual]
 

Definition at line 19 of file Connection.h.

References tcp.


Member Function Documentation

int Connection::connectByIp char addr  ) 
 

Definition at line 33 of file Connection.cpp.

References isConnected, port, and tcp.

Referenced by Gne::joinServer().

int Connection::disconnect  ) 
 

Definition at line 92 of file Connection.cpp.

References tcp.

Referenced by Gne::aPlayer(), Gne::clientThread(), Gne::disconnect(), Gne::joinServer(), Gne::listen(), and Gne::stopServer().

int Connection::getLastError  ) 
 

Definition at line 123 of file Connection.cpp.

int Connection::getPort  ) 
 

Definition at line 128 of file Connection.cpp.

References port.

int Connection::recieveData char buf,
int  size,
int  flag
 

Definition at line 99 of file Connection.cpp.

References isConnected, and tcp.

Referenced by Gne::aPlayer(), Gne::clientThread(), Gne::joinServer(), and Gne::listen().

int Connection::sendData char buf,
int  size
 

Definition at line 111 of file Connection.cpp.

References isConnected, and tcp.

Referenced by Gne::dealExtras(), Gne::joinServer(), Gne::listen(), Gne::sendAttackNT(), Gne::sendChatMsg(), Gne::sendDisconnectToAll(), Gne::sendInfo(), Gne::sendPlayer(), Gne::sendPlayerPosToAll(), Gne::setPlayerActionNT(), Gne::setPlayerDeath(), Gne::setPlayerExtras(), Gne::setPlayerName(), Gne::setPlayerPos(), Gne::setPlayerScore(), Gne::setPlayerState(), and Gne::updatePlayersFromServer().

Connection * Connection::waitForConnection  ) 
 

Definition at line 53 of file Connection.cpp.

References Connection(), isConnected, isOpen, LOG_ERROR, port, sin, and tcp.

Referenced by Gne::listen().

Here is the call graph for this function:


Member Data Documentation

bool Connection::isConnected [private]
 

Definition at line 13 of file Connection.h.

Referenced by connectByIp(), Connection(), recieveData(), sendData(), and waitForConnection().

bool Connection::isOpen [private]
 

Definition at line 14 of file Connection.h.

Referenced by Connection(), and waitForConnection().

SOCKET Connection::ls [private]
 

Definition at line 10 of file Connection.h.

int Connection::port [private]
 

Definition at line 11 of file Connection.h.

Referenced by connectByIp(), Connection(), getPort(), and waitForConnection().

struct sockaddr_in Connection::sin [private]
 

Definition at line 12 of file Connection.h.

Referenced by waitForConnection().

SOCKET Connection::tcp [private]
 

Definition at line 9 of file Connection.h.

Referenced by connectByIp(), Connection(), disconnect(), recieveData(), sendData(), waitForConnection(), and ~Connection().


Generated on Sun Jun 5 15:49:22 2005 for Defacto by  doxygen 1.4.3