// $Id$
//
-#include "receiver.h"
+#include "plaqui/server/receiver.h"
-/*
-Receiver::Receiver(int port, std::string host): Connection(sockbuf::dgram) {
+using namespace PlaQui::Server;
+
+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;
+ }
+}