Public Types | |
| enum | EProtocol { kTCP, kUDP, kInvalidProtocol } |
Public Member Functions | |
| TMCSocket () | |
| ~TMCSocket () | |
| void | Init (EProtocol protocol, int32 portNumber) |
| void | SendBroadcast (uint32 broadcastAddress, const TMCString &message) |
| void | BindToPort () |
| boolean | WaitForReadableData (float timeOutInSeconds) |
| void | ListenForConnections () |
| bool | Accept (TMCSocket &outSocket, float timeOutInSeconds) |
| bool | Connect (const char *serverAddress, float timeOut) |
| int32 | GetData (char *buffer, int32 bufferSize) |
| int32 | PutData (const char *buffer, int32 bytesCount) |
| boolean | IsClosed () |
| void | Close () |
Static Public Member Functions | |
| void | Initialize () |
| void | GetHostIPAddress (uint32 &ipAddress, uint32 subNetID, uint32 subNetMask) |
| void | IPtoString (uint32 address, TMCString &string) |
| void | StringtoIP (const TMCString &string, uint32 &address) |
| void | GetDefaultSubNet (uint32 &subNetID, uint32 &subNetMask) |
| void | GetHostName (TMCString &name) |
| int32 | CheckForRead (const TMCPtrArray< TMCSocket > &socketArray, real timeOutInSeconds) |
Protected Attributes | |
| int32 | fPortNumber |
| uint32 | fSocketID |
| EProtocol | fProtocol |
Static Protected Attributes | |
| boolean | sInitialized |
|
|
|
|
|
|
|
|
|
|
||||||||||||
|
|
|
|
binds the socket to its port |
|
||||||||||||
|
|
|
|
|
|
||||||||||||
|
|
|
||||||||||||
|
returns the number of characters read |
|
||||||||||||
|
Returns the default the subnet info (the first adapter found on the system)
|
|
||||||||||||||||
|
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.
|
|
|
Returns a string that contains the name of the local machine
|
|
||||||||||||
|
|
|
|
should be called once before using any of the socket code |
|
||||||||||||
|
Returns the string that corresponds to an IP address.
|
|
|
|
|
|
|
|
||||||||||||
|
|
|
||||||||||||
|
broadcast udp message |
|
||||||||||||
|
Returns the IP address corresponding to a string
|
|
|
wait for data to be available for reading, return false if times out |
|
|
|
|
|
|
|
|
|
|
|
|
1.3.9.1