Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 23, 2005, 2:47:23 PM (18 years ago)
Author:
hdavid
Message:

added new function to NetworkSocket

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/network/src/lib/network/network_socket.cc

    r5631 r5725  
    269269
    270270/**
     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 */
     277int NetworkSocket::readBytesExact(byte * data, int length)
     278{
     279  if (incomingBufferLength >= length)
     280    return readBytes(data, length);
     281  else return 0;
     282}
     283
     284/**
    271285 * used to create a thread to listen
    272286 * will call thrad_read when established connection
Note: See TracChangeset for help on using the changeset viewer.