Game Development Reference
In-Depth Information
Status code
Description
Status::Error
There was an unexpected error during the operation
In the preceding example we try to connect to a computer on the local network
(192.168.xxx.xxx) on port 45000. In most circumstances, the port indicates which process
we want to reach (some processes can use multiple ports though). That's why we need to
know the port before we try to connect.
Once we have a connection, we can send over data by calling the TcpSock-
et::send() method, which requires a pointer to an array of data and its size and re-
turns a Status code. Status does not indicate if the other side has received the mes-
sage, but only if it has been sent. Here is an example:
On the other side we have a TcpListener , which waits for incoming connections and
reads the data. Let us look at the following code:
Search WWH ::




Custom Search