copied everything over from 2012 and removed all of the actual robot code except the drivetrain stuff
git-svn-id: https://robotics.mvla.net/svn/frc971/2013/trunk/src@4078 f308d9b7-e957-4cde-b6ac-9a88185e7312
diff --git a/aos/common/network/ReceiveSocket.cpp b/aos/common/network/ReceiveSocket.cpp
new file mode 100644
index 0000000..671f966
--- /dev/null
+++ b/aos/common/network/ReceiveSocket.cpp
@@ -0,0 +1,32 @@
+#include "ReceiveSocket.h"
+#include <string.h>
+#include <math.h>
+#include <errno.h>
+#include <stdint.h>
+#include <stddef.h>
+
+#include "aos/common/network/SocketLibraries.h"
+#include "aos/aos_core.h"
+
+namespace aos {
+
+static const char *localhost = "0.0.0.0";
+
+int ReceiveSocket::Connect(NetworkPort port) {
+ Reset();
+ const int ret = Socket::Connect(port, localhost);
+ if (ret != 0) {
+ return ret;
+ }
+
+ if (bind(socket_, &addr_.addr,
+ sizeof(addr_)) == -1) {
+ LOG(ERROR, "failed to bind to address '%s' because of %d: %s\n", localhost,
+ errno, strerror(errno));
+ return last_ret_ = -1;
+ }
+ return last_ret_ = 0;
+}
+
+} // namespace aos
+