Public Member Functions | Protected Member Functions
NetLink Class Reference

Brief description of class still missing. More...

#include <NetLink.h>

Inheritance diagram for NetLink:
DaemonLink

List of all members.

Public Member Functions

 NetLink (Station *station)

Protected Member Functions

virtual int bytesAvailable (const char *buffer, int bytesCount)

Detailed Description

Brief description of class still missing.

Full description of class still missing


Constructor & Destructor Documentation

NetLink::NetLink ( Station station)

Description of constructor still missing

References DaemonLink::setPort(), and TRACE.

  : DaemonLink(station)
{
  TRACE;
  setPort(2979);
}

Member Function Documentation

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;
}

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines