#include <XFuInetNetwork.h>
Inheritance diagram for XFuInetNetwork:
Public Member Functions | |
virtual | ~XFuInetNetwork () |
Destructor. | |
virtual void | reset () |
Resets the communication manager. | |
virtual void | runCommunicationScheduler () |
Runs the communication scheduler. | |
virtual void | clientLost (INT32 aClientId) |
Connection lost handler (XFuClientLost) (callback). | |
virtual INT | handleSender (const void *aAddress, const CHAR8 *aData, INT32 aLen) |
Handle data from an unknown client (callback). | |
virtual INT | enableService (INT32 aMaxClients, UINT16 aPort, INT32 aDefaultSpeed) |
Enables the inet communication handler and opens it for service. | |
virtual void | closeService () |
Closes the currently active service (communication handler). | |
virtual XFcClientCommWin * | getClient (INT32 aClientId) |
Returns the specified client. | |
virtual INT32 | addClient (XFcAddress *aAddress, INT32 aTimeoutTime=15000) |
Adds a client with the specific address. | |
virtual void | removeClient (INT32 aClientId) |
Removes the specified client. | |
virtual void | removeAllClients () |
Removes all clients. | |
virtual UINT32 | getAcceptGameToken () |
Returns the game token that is checked before new clients are allowed to connect. | |
virtual void | setAcceptGameToken (UINT32 aAcceptGameToken) |
Sets the game token that is checked before new clients are allowed to connect. | |
virtual void | sendGameConnectPacket (INT32 aClientId, UINT32 aGameToken) |
Sends a game connection packet. | |
virtual XFcDataReceiver * | getDefaultDataReceiver () |
Returns a pointer to the default data receiver. | |
virtual void | setDefaultDataReceiver (XFcDataReceiver *aReceiver) |
Sets the default data receiver. | |
virtual XFcDataReceiver * | getDataReceiver (UINT32 aId) |
Returns the specified data receiver. | |
virtual INT | addDataReceiver (UINT32 aId, XFcDataReceiver *aReceiver) |
Adds a new data receiver. | |
virtual XFcDataReceiver * | removeDataReceiver (UINT32 aId) |
Removes a data receiver. | |
virtual INT32 | getRoundTripTime (INT32 aClientId) |
Returns the round trip time for the specified client. | |
virtual XFcObjectDataFrame * | getPacketFrame (INT32 aClientId, XFCNET_MESSAGE_SLOT aSlot) |
Get packet frame. | |
virtual XFcObjectDataFrame * | getRecentStateFrame (INT32 aClientId, INT32 aRecentId) |
Get recent state frame. | |
virtual void | removeRecentStateFrame (INT32 aClientId, INT32 aRecentId) |
Remove recent state frame. | |
virtual INT32 | send (INT32 aClientId, UINT32 aReceiverId, XFCNET_MESSAGE_SLOT aSlot, XFuSerializable *aSerializable) |
Sends a serializable object to the specified client. | |
virtual INT32 | sendRecentState (INT32 aClientId, UINT32 aReceiverId, INT32 aRecentId, XFuSerializable *aSerializable) |
Sends a serializable object to the specified client as a recent state packet. | |
virtual void | addEventHandler (XFuNetworkEventHandler *aHandler) |
Adds a communication event handler. | |
virtual void | removeEventHandler (XFuNetworkEventHandler *aHandler) |
Removes a communication event handler. | |
virtual void | removeAllEventHandlers () |
Removes all communication event handlers. | |
virtual INT | startAdvertiser (const CHAR8 *aMessage, UINT16 aAdvertisePort) |
Cretes advertiser for opened service. | |
virtual void | stopAdvertiser () |
Stops the advertiser service. | |
virtual INT | startServerDiscovery (const CHAR8 *aMessage, UINT16 aAdvertisePort) |
Starts server device discovery. | |
virtual void | stopServerDiscovery () |
Stops device discovery. | |
virtual void | deviceDiscovery (const XFcLinkedList< XFcAdvertiser * > &aAdvertiser) |
Inherited from XFcDeviceDiscovery. | |
virtual void | deviceDiscovery (const XFcLinkedList< XFcHostEntry * > &) |
Inherited from XFcDeviceDiscovery. | |
virtual INT | deviceLocalName (XFcName &aName) |
Gets device local name. | |
Static Public Member Functions | |
XFuInetNetwork * | create () |
Static constructor. | |
Protected Member Functions | |
XFuInetNetwork () | |
Protected constructor. | |
virtual void | initClients (INT32 aMaxClients) |
Reserves memory for the client array (mClients) and initializes all the client pointers to NULL. | |
virtual void | deleteAllClients () |
Cleanup of all clients. | |
virtual INT | init () |
Initializes default communication manager specific items that would normally be in the constructor. | |
Private Attributes | |
XFuDynamicArray< XFuNetworkEventHandler * > * | mNetworkEventHandlers |
Pointer to array of communication event handlers. | |
XFcCommunicationScheduler * | mCommunicationScheduler |
Pointer to the communication scheduler. | |
XFcInetHandler * | mCommunicationHandler |
Pointer to the communication handler. | |
XFcDataReceiver * | mDefaultDataReceiver |
Pointer to the default data receiver. | |
INT32 | mCommunicationHandlerId |
Id of the communication handler. | |
XFcHashtable< UINT32, XFcInetClientWin * > | mClients |
Array of pointers to clients. | |
INT32 | mMaxClients |
Maximum number of clients. | |
UINT32 | mAcceptGameToken |
Game token that is checked before new clients are allowed to connect. | |
INT | mAdvertiserStatus |
Holds status of advertiser device query. | |
UINT16 | mGamePort |
Holds inet server port. | |
XFcInetHostResolver * | mHostResolver |
Pointer to the communication service. | |
XFcInetCommService * | mCommService |
Pointer to the inet communication service. |
Definition at line 44 of file XFuInetNetwork.h.
|
Protected constructor.
Definition at line 51 of file XFuInetNetwork.cpp. References mAcceptGameToken, mAdvertiserStatus, mCommService, mCommunicationHandler, mCommunicationHandlerId, mCommunicationScheduler, mHostResolver, mMaxClients, and mNetworkEventHandlers. |
|
Destructor.
Definition at line 71 of file XFuInetNetwork.cpp. References closeService(), deleteAllClients(), mCommService, mCommunicationHandler, mHostResolver, mNetworkEventHandlers, and removeAllEventHandlers(). |
|
Adds a client with the specific address.
Implements XFuNetwork. Definition at line 333 of file XFuInetNetwork.cpp. References mClients, and mCommunicationScheduler. Referenced by handleSender(). |
|
Adds a new data receiver.
Implements XFuNetwork. Definition at line 280 of file XFuInetNetwork.cpp. References mCommunicationScheduler. |
|
Adds a communication event handler.
Implements XFuNetwork. Definition at line 294 of file XFuInetNetwork.cpp. References mNetworkEventHandlers, and XFuDynamicArray< XFuNetworkEventHandler * >::put(). |
|
Connection lost handler (XFuClientLost) (callback).
Definition at line 445 of file XFuInetNetwork.cpp. References XFuDynamicArray< XFuNetworkEventHandler * >::get(), XFuNetworkEventHandler::handleClientLost(), mNetworkEventHandlers, removeClient(), and XFuDynamicArray< XFuNetworkEventHandler * >::size(). |
|
Closes the currently active service (communication handler).
Implements XFuNetwork. Definition at line 158 of file XFuInetNetwork.cpp. References mCommService, mCommunicationHandler, mCommunicationScheduler, mHostResolver, stopAdvertiser(), and stopServerDiscovery(). Referenced by enableService(), reset(), and ~XFuInetNetwork(). |
|
Static constructor.
Definition at line 38 of file XFuInetNetwork.cpp. References init(). |
|
Cleanup of all clients.
Definition at line 222 of file XFuInetNetwork.cpp. References getClient(), mClients, and mCommunicationScheduler. Referenced by ~XFuInetNetwork(). |
|
Inherited from XFcDeviceDiscovery.
Definition at line 220 of file XFuInetNetwork.h. |
|
Inherited from XFcDeviceDiscovery.
Definition at line 558 of file XFuInetNetwork.cpp. References XFuDynamicArray< XFuNetworkEventHandler * >::get(), XFuNetworkEventHandler::handleAdvertiseDiscovered(), mNetworkEventHandlers, and XFuDynamicArray< XFuNetworkEventHandler * >::size(). |
|
Gets device local name.
Definition at line 582 of file XFuInetNetwork.cpp. References mHostResolver. |
|
Enables the inet communication handler and opens it for service. Use port 0 for random port. Default speed is one of the XFuNET_CONNECTION_SPEED values (see XFcClientCommWin.h) Definition at line 123 of file XFuInetNetwork.cpp. References closeService(), initClients(), mCommService, mCommunicationHandler, mCommunicationHandlerId, mCommunicationScheduler, mGamePort, and removeAllClients(). |
|
Returns the game token that is checked before new clients are allowed to connect.
Definition at line 181 of file XFuInetNetwork.cpp. References mAcceptGameToken. |
|
Returns the specified client.
Implements XFuNetwork. Definition at line 315 of file XFuInetNetwork.cpp. References mClients. Referenced by deleteAllClients(), and removeClient(). |
|
Returns the specified data receiver.
Implements XFuNetwork. Definition at line 273 of file XFuInetNetwork.cpp. References mCommunicationScheduler. |
|
Returns a pointer to the default data receiver.
Implements XFuNetwork. Definition at line 258 of file XFuInetNetwork.cpp. References mDefaultDataReceiver. |
|
Get packet frame.
Implements XFuNetwork. Definition at line 383 of file XFuInetNetwork.cpp. References mCommunicationScheduler. Referenced by send(), and sendGameConnectPacket(). |
|
Get recent state frame.
Implements XFuNetwork. Definition at line 390 of file XFuInetNetwork.cpp. References mCommunicationScheduler. Referenced by sendRecentState(). |
|
Returns the round trip time for the specified client.
Definition at line 376 of file XFuInetNetwork.cpp. References mCommunicationScheduler. |
|
Handle data from an unknown client (callback).
Definition at line 458 of file XFuInetNetwork.cpp. References addClient(), XFuDynamicArray< XFuNetworkEventHandler * >::get(), XFuNetworkEventHandler::handleClientAccepted(), mAcceptGameToken, mNetworkEventHandlers, and XFuDynamicArray< XFuNetworkEventHandler * >::size(). |
|
Initializes default communication manager specific items that would normally be in the constructor.
Definition at line 86 of file XFuInetNetwork.cpp. References XFuDynamicArray< T >::create(), mCommunicationScheduler, and mNetworkEventHandlers. |
|
Reserves memory for the client array (mClients) and initializes all the client pointers to NULL. Reserves memory for the client array (mClients) and initializes all the client pointers to NULL Definition at line 215 of file XFuInetNetwork.cpp. References mMaxClients. Referenced by enableService(). |
|
Removes all clients.
Implements XFuNetwork. Definition at line 240 of file XFuInetNetwork.cpp. References mClients, mCommunicationHandler, and removeClient(). Referenced by enableService(), and reset(). |
|
Removes all communication event handlers.
Implements XFuNetwork. Definition at line 308 of file XFuInetNetwork.cpp. References XFuDynamicArray< XFuNetworkEventHandler * >::isEmpty(), mNetworkEventHandlers, and XFuDynamicArray< XFuNetworkEventHandler * >::remove(). Referenced by reset(), and ~XFuInetNetwork(). |
|
Removes the specified client.
Implements XFuNetwork. Definition at line 359 of file XFuInetNetwork.cpp. References getClient(), mClients, mCommunicationHandler, and mCommunicationScheduler. Referenced by clientLost(), and removeAllClients(). |
|
Removes a data receiver.
Implements XFuNetwork. Definition at line 287 of file XFuInetNetwork.cpp. References mCommunicationScheduler. |
|
Removes a communication event handler.
Implements XFuNetwork. Definition at line 301 of file XFuInetNetwork.cpp. References mNetworkEventHandlers, and XFuDynamicArray< XFuNetworkEventHandler * >::remove(). |
|
Remove recent state frame.
Implements XFuNetwork. Definition at line 397 of file XFuInetNetwork.cpp. References mCommunicationScheduler. |
|
Resets the communication manager.
Definition at line 109 of file XFuInetNetwork.cpp. References closeService(), init(), mAcceptGameToken, mMaxClients, removeAllClients(), and removeAllEventHandlers(). |
|
Runs the communication scheduler.
Implements XFuNetwork. Definition at line 102 of file XFuInetNetwork.cpp. References mCommunicationScheduler. |
|
Sends a serializable object to the specified client.
Definition at line 404 of file XFuInetNetwork.cpp. References getPacketFrame(), and XFuSerializable::serialize(). |
|
Sends a game connection packet.
Definition at line 194 of file XFuInetNetwork.cpp. References getPacketFrame(). |
|
Sends a serializable object to the specified client as a recent state packet.
Definition at line 425 of file XFuInetNetwork.cpp. References getRecentStateFrame(), and XFuSerializable::serialize(). |
|
Sets the game token that is checked before new clients are allowed to connect.
Definition at line 187 of file XFuInetNetwork.cpp. References mAcceptGameToken. |
|
Sets the default data receiver.
Implements XFuNetwork. Definition at line 265 of file XFuInetNetwork.cpp. References mCommunicationScheduler, and mDefaultDataReceiver. |
|
Cretes advertiser for opened service.
Definition at line 523 of file XFuInetNetwork.cpp. References mCommService. |
|
Starts server device discovery.
Definition at line 488 of file XFuInetNetwork.cpp. References mCommService. |
|
Stops the advertiser service.
Definition at line 549 of file XFuInetNetwork.cpp. References mCommService. Referenced by closeService(). |
|
Stops device discovery.
Definition at line 516 of file XFuInetNetwork.cpp. References mCommService. Referenced by closeService(). |
|
Game token that is checked before new clients are allowed to connect.
Definition at line 73 of file XFuInetNetwork.h. Referenced by getAcceptGameToken(), handleSender(), reset(), setAcceptGameToken(), and XFuInetNetwork(). |
|
Holds status of advertiser device query.
Definition at line 76 of file XFuInetNetwork.h. Referenced by XFuInetNetwork(). |
|
Array of pointers to clients.
Definition at line 67 of file XFuInetNetwork.h. Referenced by addClient(), deleteAllClients(), getClient(), removeAllClients(), and removeClient(). |
|
Pointer to the inet communication service.
Definition at line 85 of file XFuInetNetwork.h. Referenced by closeService(), enableService(), startAdvertiser(), startServerDiscovery(), stopAdvertiser(), stopServerDiscovery(), XFuInetNetwork(), and ~XFuInetNetwork(). |
|
Pointer to the communication handler.
Definition at line 58 of file XFuInetNetwork.h. Referenced by closeService(), enableService(), removeAllClients(), removeClient(), XFuInetNetwork(), and ~XFuInetNetwork(). |
|
Id of the communication handler.
Definition at line 64 of file XFuInetNetwork.h. Referenced by enableService(), and XFuInetNetwork(). |
|
Pointer to the communication scheduler.
Definition at line 55 of file XFuInetNetwork.h. Referenced by addClient(), addDataReceiver(), closeService(), deleteAllClients(), enableService(), getDataReceiver(), getPacketFrame(), getRecentStateFrame(), getRoundTripTime(), init(), removeClient(), removeDataReceiver(), removeRecentStateFrame(), runCommunicationScheduler(), setDefaultDataReceiver(), and XFuInetNetwork(). |
|
Pointer to the default data receiver.
Definition at line 61 of file XFuInetNetwork.h. Referenced by getDefaultDataReceiver(), and setDefaultDataReceiver(). |
|
Holds inet server port.
Definition at line 79 of file XFuInetNetwork.h. Referenced by enableService(). |
|
Pointer to the communication service.
Definition at line 82 of file XFuInetNetwork.h. Referenced by closeService(), deviceLocalName(), XFuInetNetwork(), and ~XFuInetNetwork(). |
|
Maximum number of clients.
Definition at line 70 of file XFuInetNetwork.h. Referenced by initClients(), reset(), and XFuInetNetwork(). |
|
Pointer to array of communication event handlers.
Definition at line 52 of file XFuInetNetwork.h. Referenced by addEventHandler(), clientLost(), deviceDiscovery(), handleSender(), init(), removeAllEventHandlers(), removeEventHandler(), XFuInetNetwork(), and ~XFuInetNetwork(). |
![]() | ||||
![]() |
Confidential Copyright © 2002-2003 Fathammer | with doxygen by Dimitri van Heesch |