Open Game Engine 2D API
|
Functions | |
int | OGE_OpenLocalServer (int iPort) |
Let the local server start to listen on some port. | |
int | OGE_CloseLocalServer () |
Let the local server stop listening. | |
int | OGE_ConnectServer (string sAddr) |
Connect the server with network address (IP:Port) | |
int | OGE_DisconnectServer (string sAddr) |
Disconnect the server with the network address. | |
int | OGE_DisconnectClient (string sAddr) |
Disconnect the client by network address. | |
string | OGE_GetSocketAddr (int iSockId) |
Get the network address of the socket. | |
int | OGE_GetCurrentSocket () |
Get current socket. | |
int | OGE_GetUserSocket (int idx) |
Get the user socket by index. | |
void | OGE_SetUserSocket (int iSockId, int idx) |
Set the user socket with index. | |
int | OGE_GetRecvDataSize () |
Get the size of current receive data. | |
int | OGE_GetRecvDataType () |
Get the type of current receive data. | |
char | OGE_GetRecvByte (int pos, int &next) |
Read a byte from the receiving buffer. | |
int | OGE_GetRecvInt (int pos, int &next) |
Read an integer from the receiving buffer. | |
double | OGE_GetRecvFloat (int pos, int &next) |
Read a floating-point value from the receiving buffer. | |
int | OGE_GetRecvBuf (int pos, int len, int buf, int &next) |
Copy bytes from the receiving buffer into another buffer. | |
string | OGE_GetRecvStr (int pos, int len, int &next) |
Read a string from the receiving buffer. | |
int | OGE_PutSendingByte (int iSockId, int pos, char value) |
Write a byte into the sending buffer of the socket. | |
int | OGE_PutSendingInt (int iSockId, int pos, int value) |
Write an integer into the sending buffer of the socket. | |
int | OGE_PutSendingFloat (int iSockId, int pos, double value) |
Write a floating-point value into the sending buffer of the socket. | |
int | OGE_PutSendingBuf (int iSockId, int pos, int buf, int len) |
Copy bytes from a buffer into the sending buffer of the socket. | |
int | OGE_PutSendingStr (int iSockId, int pos, string value) |
Write a string into the sending buffer of the socket. | |
int | OGE_SendData (int iSockId, int iDataSize) |
Send the data in the sending buffer of the socket. | |
string | OGE_GetLocalIP () |
Get local IP address. | |
int | OGE_FindClient (string sAddr) |
Find a client socket by network address. | |
int | OGE_FindServer (string sAddr) |
Find a server socket by network address. | |
int | OGE_GetLocalServer () |
Get the socket of the local server. |
int OGE_CloseLocalServer | ( | ) |
Let the local server stop listening.
int OGE_ConnectServer | ( | string | sAddr | ) |
Connect the server with network address (IP:Port)
[in] | sAddr | The network address (IP:Port) |
int OGE_DisconnectClient | ( | string | sAddr | ) |
Disconnect the client by network address.
[in] | sAddr | The network address (IP:Port) |
int OGE_DisconnectServer | ( | string | sAddr | ) |
Disconnect the server with the network address.
[in] | sAddr | The network address (IP:Port) |
int OGE_FindClient | ( | string | sAddr | ) |
Find a client socket by network address.
[in] | sAddr | The network address (IP:Port) |
int OGE_FindServer | ( | string | sAddr | ) |
Find a server socket by network address.
[in] | sAddr | The network address (IP:Port) |
int OGE_GetCurrentSocket | ( | ) |
Get current socket.
string OGE_GetLocalIP | ( | ) |
Get local IP address.
int OGE_GetLocalServer | ( | ) |
Get the socket of the local server.
int OGE_GetRecvBuf | ( | int | pos, |
int | len, | ||
int | buf, | ||
int & | next | ||
) |
Copy bytes from the receiving buffer into another buffer.
[in] | pos | Current reading position |
[in] | len | The count of the bytes |
[in] | buf | The ID of the target buffer |
[out] | next | Next reading position |
char OGE_GetRecvByte | ( | int | pos, |
int & | next | ||
) |
Read a byte from the receiving buffer.
[in] | pos | Current reading position |
[out] | next | Next reading position |
int OGE_GetRecvDataSize | ( | ) |
Get the size of current receive data.
int OGE_GetRecvDataType | ( | ) |
Get the type of current receive data.
double OGE_GetRecvFloat | ( | int | pos, |
int & | next | ||
) |
Read a floating-point value from the receiving buffer.
[in] | pos | Current reading position |
[out] | next | Next reading position |
int OGE_GetRecvInt | ( | int | pos, |
int & | next | ||
) |
Read an integer from the receiving buffer.
[in] | pos | Current reading position |
[out] | next | Next reading position |
string OGE_GetRecvStr | ( | int | pos, |
int | len, | ||
int & | next | ||
) |
Read a string from the receiving buffer.
[in] | pos | Current reading position |
[in] | len | The length of the string |
[out] | next | Next reading position |
string OGE_GetSocketAddr | ( | int | iSockId | ) |
Get the network address of the socket.
[in] | iSockId | The ID of the socket |
int OGE_GetUserSocket | ( | int | idx | ) |
Get the user socket by index.
[in] | idx | The index |
int OGE_OpenLocalServer | ( | int | iPort | ) |
Let the local server start to listen on some port.
[in] | iPort | The listening port |
int OGE_PutSendingBuf | ( | int | iSockId, |
int | pos, | ||
int | buf, | ||
int | len | ||
) |
Copy bytes from a buffer into the sending buffer of the socket.
[in] | iSockId | The ID of the socket |
[in] | pos | Current writing position |
[in] | buf | The ID of source buffer |
[in] | len | The count of the bytes |
int OGE_PutSendingByte | ( | int | iSockId, |
int | pos, | ||
char | value | ||
) |
Write a byte into the sending buffer of the socket.
[in] | iSockId | The ID of the socket |
[in] | pos | Current writing position |
[in] | value | The value of the byte |
int OGE_PutSendingFloat | ( | int | iSockId, |
int | pos, | ||
double | value | ||
) |
Write a floating-point value into the sending buffer of the socket.
[in] | iSockId | The ID of the socket |
[in] | pos | Current writing position |
[in] | value | The floating-point value |
int OGE_PutSendingInt | ( | int | iSockId, |
int | pos, | ||
int | value | ||
) |
Write an integer into the sending buffer of the socket.
[in] | iSockId | The ID of the socket |
[in] | pos | Current writing position |
[in] | value | The value of the integer |
int OGE_PutSendingStr | ( | int | iSockId, |
int | pos, | ||
string | value | ||
) |
Write a string into the sending buffer of the socket.
[in] | iSockId | The ID of the socket |
[in] | pos | Current writing position |
[in] | value | The string |
int OGE_SendData | ( | int | iSockId, |
int | iDataSize | ||
) |
Send the data in the sending buffer of the socket.
[in] | iSockId | The ID of the socket |
[in] | iDataSize | The size of the data |
void OGE_SetUserSocket | ( | int | iSockId, |
int | idx | ||
) |
Set the user socket with index.
[in] | iSockId | The ID of the socket |
[in] | idx | The index |