Brief description of class still missing. More...
#include <NetLink.h>
Public Member Functions | |
NetLink (Station *station) | |
Protected Member Functions | |
virtual int | bytesAvailable (const char *buffer, int bytesCount) |
Brief description of class still missing.
Full description of class still missing
NetLink::NetLink | ( | Station * | station | ) |
Description of constructor still missing
References DaemonLink::setPort(), and TRACE.
: DaemonLink(station) { TRACE; setPort(2979); }
int NetLink::bytesAvailable | ( | const char * | buffer, |
int | bytesCount | ||
) | [protected, virtual] |
Implements DaemonLink.
References bytesAvailable(), Station::setBuddies(), DaemonLink::station(), and TRACE.
Referenced by bytesAvailable().
{ TRACE; int bytesRead=0; while(bytesRead<bytesCount) { // Scan for a line int newBytesRead; for(newBytesRead=bytesRead; newBytesRead<bytesCount && buffer[newBytesRead]!='\n'; newBytesRead++) {} if(newBytesRead==bytesCount) { return bytesRead; // partial line } station()->setBuddies(QString::fromAscii(buffer+bytesRead, newBytesRead-bytesRead)); bytesRead=newBytesRead+1; // Skip blanks and additionnal end of line characters while(bytesRead<bytesCount && isspace(buffer[bytesRead])) {bytesRead++;} } return bytesRead; }