]> git.llucax.com Git - z.facultad/75.42/plaqui.git/blobdiff - Server/src/receiver.cpp
Se agrega un doxyfile para generar docs del server.
[z.facultad/75.42/plaqui.git] / Server / src / receiver.cpp
index 172a19f63e8aae99ec1b0108b4eb4bb32e9886e2..4f720f4450c0af6196e4ae419dde066c57ef1e3a 100644 (file)
 // $Id$
 //
 
-#include "receiver.h"
+#include "plaqui/server/receiver.h"
 
-/*
-Receiver::Receiver(int port, std::string host): Connection(sockbuf::dgram) {
+using namespace Plaqui;
+
+Receiver::Receiver(int port, std::string host):
+               Connection(sockbuf::sock_dgram) {
+       // FIXME - deberia ir en run().
        socket->bind(port);
 }
-*/
+
+void Receiver::run(void) {
+       // FIXME - debería tirar una excepción?
+       if (!socket->is_open()) {
+               std::cerr << "No se pudo conectar a " << socket->peerhost() <<
+                       ":" << socket->peerport() << "." << std::endl;
+       } else {
+               std::cerr << "Conectado a " << socket->peerhost() <<
+                       ":" << socket->peerport() << "." << std::endl;
+       }
+}