
Public Member Functions | |
| virtual MCErr MCCOMAPI | QueryInterface (const MCIID &riid, void **ppvObj) |
| virtual uint32 MCCOMAPI | AddRef () |
| virtual uint32 MCCOMAPI | Release () |
| virtual void MCCOMAPI | Init (EProtocol protocol, int32 portNumber) |
| virtual void MCCOMAPI | SendBroadcast (uint32 broadcastAddress, const TMCString &message) |
| virtual void MCCOMAPI | BindToPort () |
| virtual boolean MCCOMAPI | WaitForReadableData (float timeOutInSeconds) |
| virtual void MCCOMAPI | ListenForConnections () |
| virtual bool MCCOMAPI | Accept (IMCSocket *outSocket, float timeOutInSeconds) |
| virtual bool MCCOMAPI | Connect (const char *serverAddress, float timeOut) |
| virtual int32 MCCOMAPI | GetData (char *buffer, int32 bufferSize) |
| virtual int32 MCCOMAPI | PutData (const char *buffer, int32 bytesCount) |
| virtual boolean MCCOMAPI | IsClosed () |
| virtual void MCCOMAPI | Close () |
Static Public Member Functions | |
| static void | Initialize () |
| static void | GetHostIPAddress (uint32 &ipAddress, uint32 subNetID, uint32 subNetMask) |
| static void | IPtoString (uint32 address, TMCString &string) |
| static void | StringtoIP (const TMCString &string, uint32 &address) |
| static void | GetDefaultSubNet (uint32 &subNetID, uint32 &subNetMask) |
| static void | GetHostName (TMCString &name) |
| static int32 | CheckForRead (const TMCCountedPtrArray< IMCSocket > &socketArray, real timeOutInSeconds) |
| static void | Create (IMCSocket **socket) |
Protected Member Functions | |
| TMCSocket () | |
| ~TMCSocket () | |
Protected Attributes | |
| int32 | fPortNumber |
| uint32 | fSocketID |
| EProtocol | fProtocol |
Static Protected Attributes | |
| static boolean | sInitialized |
Classes | |
| struct | IPAddress |
| TMCSocket::TMCSocket | ( | ) | [protected] |
| TMCSocket::~TMCSocket | ( | ) | [protected] |
| static void TMCSocket::Initialize | ( | ) | [static] |
should be called once before using any of the socket code
| static void TMCSocket::GetHostIPAddress | ( | uint32 & | ipAddress, | |
| uint32 | subNetID, | |||
| uint32 | subNetMask | |||
| ) | [static] |
Returns the IP address of the local machine on a given sub net. If no address matches the given subnet then the first ip address is returned.
| ipAddress | The IP Address | |
| subNetID | The ID of the sub Net | |
| subNetMask | The mask of the sub Net |
Returns the string that corresponds to an IP address.
| address | The IP address | |
| string | The string |
Returns the IP address corresponding to a string
| address | The IP address | |
| string | The string |
Returns the default the subnet info (the first adapter found on the system)
| subNetID | The ID of the sub Net | |
| subNetMask | The mask of the sub Net |
| static void TMCSocket::GetHostName | ( | TMCString & | name | ) | [static] |
Returns a string that contains the name of the local machine
| name | The name of the local machine |
| static int32 TMCSocket::CheckForRead | ( | const TMCCountedPtrArray< IMCSocket > & | socketArray, | |
| real | timeOutInSeconds | |||
| ) | [static] |
| static void TMCSocket::Create | ( | IMCSocket ** | socket | ) | [static] |
| virtual MCErr MCCOMAPI TMCSocket::QueryInterface | ( | const MCIID & | riid, | |
| void ** | ppvObj | |||
| ) | [inline, virtual] |
Check if the object supports a given interface and returns a pointer to that interface if it does. Note that QueryInterface will increment the reference count of the object by one if the interface is found.
| riid | GUID of the interface | |
| ppvObj | A pointer to the pointer being returned. |
Reimplemented from TMCSMPCountedObject.
| virtual uint32 MCCOMAPI TMCSocket::AddRef | ( | ) | [inline, virtual] |
Increments the reference count of the object
Reimplemented from TMCSMPCountedObject.
| virtual uint32 MCCOMAPI TMCSocket::Release | ( | ) | [inline, virtual] |
Decrements the reference count of the object. If the reference count reaches zero, the object is destroyed.
Reimplemented from TMCSMPCountedObject.
Initializes the socket.
| protocol | The protocol to use for the socket | |
| portNumber | The port number to which the socket should be attached |
Implements IMCSocket.
| virtual void MCCOMAPI TMCSocket::SendBroadcast | ( | uint32 | broadcastAddress, | |
| const TMCString & | message | |||
| ) | [virtual] |
broadcast udp message
Implements IMCSocket.
| virtual void MCCOMAPI TMCSocket::BindToPort | ( | ) | [virtual] |
binds the socket to its port
Implements IMCSocket.
wait for data to be available for reading, return false if times out
Implements IMCSocket.
| virtual void MCCOMAPI TMCSocket::ListenForConnections | ( | ) | [virtual] |
Implements IMCSocket.
Waits for a connection on a socket. Returns a new socket if a connection is established
| outSocket | ||
| timeOutInSeconds |
Implements IMCSocket.
| virtual bool MCCOMAPI TMCSocket::Connect | ( | const char * | serverAddress, | |
| float | timeOut | |||
| ) | [virtual] |
Implements IMCSocket.
returns the number of characters read
Implements IMCSocket.
Implements IMCSocket.
| virtual void MCCOMAPI TMCSocket::Close | ( | ) | [virtual] |
Closes the socket.
Implements IMCSocket.
boolean TMCSocket::sInitialized [static, protected] |
int32 TMCSocket::fPortNumber [protected] |
uint32 TMCSocket::fSocketID [protected] |
EProtocol TMCSocket::fProtocol [protected] |
1.5.3