-
Notifications
You must be signed in to change notification settings - Fork 1
/
NetworkReader.cpp
42 lines (36 loc) · 975 Bytes
/
NetworkReader.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/* Copyright (C) 2015 Willi Menapace <[email protected]>, Simone Lorengo - All Rights Reserved
* Unauthorized copying of this file, via any medium is strictly prohibited
* Proprietary and confidential
* Written by Willi Menapace <[email protected]>
*/
#include "NetworkReader.h"
#include "GlobalDefines.h"
#ifdef OFFBOARD
std::istream *NetworkReader::getStream() {
//Se il socket non e' stato impostato
if(client == 0) {
return 0;
}
return client->getInputReader()->getStream();
}
#endif // ONFFBOARD
#ifdef ONBOARD
Stream *NetworkReader::getStream() {
if(client == 0) {
return 0;
}
return client;
}
#endif // ONFFBOARD
void NetworkReader::initialize(Client *_client) {
client = _client;
}
bool NetworkReader::isConnected() {
if(client == 0) {
return false;
}
return client->connected();
}
NetworkReader::NetworkReader() {
client = 0;
}