Faucet does not support splitting tcp data into messages - this is something else I should add in the future, since it is a very very common task.
For now though, you have to split the stream of incoming data into messages yourself. One of the most common ways to frame messages is by prefixing them with a length. That means, to receive a message, you first get the length (e.g. 2 bytes, depending on the needs of your protocol) and then as many bytes as the message is long.
In order to do this, you can use tcp_receive(socket, size), which will return true if the requested ammount of data has been received, and false if it hasn't. Once it returns true, you can read the data from the socket's receive buffer. To make a simple (blocking) example:
while(!tcp_receive(socket, 2)) {}
msglen = read_ushort(socket);
while(!tcp_receive(socket, msglen)) {}
// read the message content from the buffer and process itOf course, in an actual game you will not want to block in this way, but rather check for new messages every step and continue on once no more of them are available. Look at the Pong example program for that (Objects/Client/Begin Step).
Edited by Medo42, 23 May 2012 - 06:45 PM.