# IMCSocket Struct Reference

Inheritance diagram for IMCSocket:

List of all members.

## Public Types
enum | EProtocol { kTCP, kUDP, kInvalidProtocol }
## Public Member Functions
virtual void MCCOMAPI | Init (EProtocol protocol, int32 portNumber)=0
virtual void MCCOMAPI | SendBroadcast (uint32 broadcastAddress, const TMCString &message)=0
virtual void MCCOMAPI | BindToPort ()=0
virtual boolean MCCOMAPI | WaitForReadableData (float timeOutInSeconds)=0
virtual void MCCOMAPI | ListenForConnections ()=0
virtual bool MCCOMAPI | Accept (IMCSocket *outSocket, float timeOutInSeconds)=0
virtual bool MCCOMAPI | Connect (const char *serverAddress, float timeOut)=0
virtual int32 MCCOMAPI | GetData (char *buffer, int32 bufferSize)=0
virtual int32 MCCOMAPI | PutData (const char *buffer, int32 bytesCount)=0
virtual boolean MCCOMAPI | IsClosed ()=0
virtual void MCCOMAPI | Close ()=0

## Member Enumeration Documentation

enum IMCSocket::EProtocol

Enumerator:

  kTCP |
  kUDP |
  kInvalidProtocol |

## Member Function Documentation

virtual bool MCCOMAPI IMCSocket::Accept | ( | IMCSocket * | outSocket,
|  | float | timeOutInSeconds |
| ) |  |  | `[pure virtual]`

Waits for a connection on a socket. Returns a new socket if a connection is established

Parameters:

  | outSocket |
  | timeOutInSeconds |

Implemented in TMCSocket.

virtual void MCCOMAPI IMCSocket::BindToPort | ( |  | ) | `[pure virtual]`

binds the socket to its port

Implemented in TMCSocket.

virtual void MCCOMAPI IMCSocket::Close | ( |  | ) | `[pure virtual]`

Closes the socket.

Implemented in TMCSocket.

virtual bool MCCOMAPI IMCSocket::Connect | ( | const char * | serverAddress,
|  | float | timeOut |
| ) |  |  | `[pure virtual]`

Implemented in TMCSocket.

virtual int32 MCCOMAPI IMCSocket::GetData | ( | char * | buffer,
|  | int32 | bufferSize |
| ) |  |  | `[pure virtual]`

returns the number of characters read

Implemented in TMCSocket.

virtual void MCCOMAPI IMCSocket::Init | ( | EProtocol | protocol,
|  | int32 | portNumber |
| ) |  |  | `[pure virtual]`

Initializes the socket.

Parameters:

  | protocol | The protocol to use for the socket
  | portNumber | The port number to which the socket should be attached

Implemented in TMCSocket.

virtual boolean MCCOMAPI IMCSocket::IsClosed | ( |  | ) | `[pure virtual]`

Implemented in TMCSocket.

virtual void MCCOMAPI IMCSocket::ListenForConnections | ( |  | ) | `[pure virtual]`

Implemented in TMCSocket.

virtual int32 MCCOMAPI IMCSocket::PutData | ( | const char * | buffer,
|  | int32 | bytesCount |
| ) |  |  | `[pure virtual]`

Implemented in TMCSocket.

virtual void MCCOMAPI IMCSocket::SendBroadcast | ( | uint32 | broadcastAddress,
|  | const TMCString & | message |
| ) |  |  | `[pure virtual]`

broadcast udp message

Implemented in TMCSocket.

virtual boolean MCCOMAPI IMCSocket::WaitForReadableData | ( | float | timeOutInSeconds | ) | `[pure virtual]`

wait for data to be available for reading, return false if times out

Implemented in TMCSocket.

The documentation for this struct was generated from the following file:

- IMCSocket.h