Changeset 5725 in orxonox.OLD for branches/network/src/lib
- Timestamp:
- Nov 23, 2005, 2:47:23 PM (19 years ago)
- Location:
- branches/network/src/lib/network
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/network/src/lib/network/network_socket.cc
r5631 r5725 269 269 270 270 /** 271 * Reads in the bytes form the network interface and passes it to the NetworkStream. 272 * It only reads the bytes if there are enough bytes in our buffer. 273 * @param data: pointer to memory, big enough to store length bytes 274 * @param length: n bytes to read 275 * @return the number successfully read bytes. -1 on error. 0 if there are not enough bytes in our buffer. 276 */ 277 int NetworkSocket::readBytesExact(byte * data, int length) 278 { 279 if (incomingBufferLength >= length) 280 return readBytes(data, length); 281 else return 0; 282 } 283 284 /** 271 285 * used to create a thread to listen 272 286 * will call thrad_read when established connection -
branches/network/src/lib/network/network_socket.h
r5722 r5725 80 80 int writeBytes(byte * data, int length); 81 81 int readBytes(byte * data, int length); 82 int readBytesExact(byte * data, int length); 82 83 83 84 };
Note: See TracChangeset
for help on using the changeset viewer.