summaryrefslogtreecommitdiff
path: root/i/simulotron/src/gs/gs_transmitter.cc
diff options
context:
space:
mode:
authorhaller2005-12-19 21:56:10 +0000
committerhaller2005-12-19 21:56:10 +0000
commit001f91e6ddce33aec769348adc55f0c0b0c09534 (patch)
treeceb99a0da1318c3033aa86d697cc580f023ace61 /i/simulotron/src/gs/gs_transmitter.cc
parentf6ff855101ae3d98fff31c33726e852f2d505ffe (diff)
* changement sans interet dans comc
* Codage de aiguillage en cours * Ajout de fonctionnalité de traitement à GSMessage * Remaniement des constructeur de GSTransmitter * nettoyage et modification du test des gs
Diffstat (limited to 'i/simulotron/src/gs/gs_transmitter.cc')
-rw-r--r--i/simulotron/src/gs/gs_transmitter.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/i/simulotron/src/gs/gs_transmitter.cc b/i/simulotron/src/gs/gs_transmitter.cc
index e593cdb..9f53963 100644
--- a/i/simulotron/src/gs/gs_transmitter.cc
+++ b/i/simulotron/src/gs/gs_transmitter.cc
@@ -30,11 +30,16 @@
#include <sys/select.h>
#include <iostream>
-GSTransmitter::GSTransmitter(SocketClient & socket)
+GSTransmitter::GSTransmitter(SocketServer & socket)
:socket_(socket)
{
}
+GSTransmitter::GSTransmitter(const std::string & address, int port)
+{
+ socket_.connect(address, port);
+}
+
/// Renvoie 0 quand un message est récupéré, -1 sinon
int
GSTransmitter::getGS(GSMessage & gsm)
@@ -63,7 +68,7 @@ GSTransmitter::getGS(GSMessage & gsm)
| static_cast<int> (strBrut_[3]);
if(size > strBrut_.size() - 4)
return -1;
- gsm.writeGS (strBrut_.substr(4, size).data(), size);
+ gsm.appendGS (strBrut_.substr(4, size).data(), size);
strBrut_.erase (0, size + 4);
return 0;
}