source: ntrip/trunk/BNC/bncsocket.cpp@ 1345

Last change on this file since 1345 was 1345, checked in by mervart, 16 years ago

* empty log message *

File size: 2.6 KB
Line 
1/* -------------------------------------------------------------------------
2 * BKG NTRIP Client
3 * -------------------------------------------------------------------------
4 *
5 * Class: bncSocket
6 *
7 * Purpose: Subclass QIODevice (QTcpSocket, QNetworkReply)
8 *
9 * Author: L. Mervart
10 *
11 * Created: 27-Dec-2008
12 *
13 * Changes:
14 *
15 * -----------------------------------------------------------------------*/
16
17#include <iostream>
18#include <iomanip>
19
20#include "bncsocket.h"
21
22using namespace std;
23
24// Constructor
25////////////////////////////////////////////////////////////////////////////
26bncSocket::bncSocket(QTcpSocket* socket) {
27 _socket = socket;
28}
29
30// Destructor
31////////////////////////////////////////////////////////////////////////////
32bncSocket::~bncSocket() {
33}
34
35//
36////////////////////////////////////////////////////////////////////////////
37void bncSocket::connectToHost(const QString &hostName, quint16 port,
38 QIODevice::OpenMode mode) {
39 _socket->connectToHost(hostName, port, mode);
40}
41
42//
43////////////////////////////////////////////////////////////////////////////
44bool bncSocket::waitForConnected(int msecs) {
45 return _socket->waitForConnected(msecs);
46}
47
48//
49////////////////////////////////////////////////////////////////////////////
50QAbstractSocket::SocketState bncSocket::state() const {
51 return _socket->state();
52}
53
54//
55////////////////////////////////////////////////////////////////////////////
56void bncSocket::close() {
57 _socket->close();
58}
59
60//
61////////////////////////////////////////////////////////////////////////////
62qint64 bncSocket::bytesAvailable() const {
63 return _socket->bytesAvailable();
64}
65
66//
67////////////////////////////////////////////////////////////////////////////
68bool bncSocket::canReadLine() const {
69 return _socket->canReadLine();
70}
71
72//
73////////////////////////////////////////////////////////////////////////////
74QByteArray bncSocket::readLine(qint64 maxlen) {
75 return _socket->readLine(maxlen);
76}
77
78//
79////////////////////////////////////////////////////////////////////////////
80bool bncSocket::waitForReadyRead(int msecs) {
81 return _socket->waitForReadyRead(msecs);
82}
83
84//
85////////////////////////////////////////////////////////////////////////////
86qint64 bncSocket::read(char* data, qint64 maxlen) {
87 return _socket->read(data, maxlen);
88}
89
90//
91////////////////////////////////////////////////////////////////////////////
92qint64 bncSocket::write(const char* data, qint64 len) {
93 return _socket->write(data, len);
94}
95
96//
97////////////////////////////////////////////////////////////////////////////
98bool bncSocket::waitForBytesWritten(int msecs) {
99 return _socket->waitForBytesWritten(msecs);
100}
Note: See TracBrowser for help on using the repository browser.