[Sumover-dev] [svn commit] r4624 - vic/branches/mpeg4/net
sumover-dev at cs.ucl.ac.uk
sumover-dev at cs.ucl.ac.uk
Thu Feb 18 23:58:36 GMT 2010
Author: piers
Date: Thu Feb 18 23:58:36 2010
New Revision: 4624
Modified:
vic/branches/mpeg4/net/net-ip.cpp
Log:
Updated comment on re-instated connect() call.
Modified: vic/branches/mpeg4/net/net-ip.cpp
==============================================================================
--- vic/branches/mpeg4/net/net-ip.cpp (original)
+++ vic/branches/mpeg4/net/net-ip.cpp Thu Feb 18 23:58:36 2010
@@ -522,11 +522,11 @@
sin.sin_port = port;
sin.sin_addr.s_addr = INADDR_ANY;
if (bind(fd, (struct sockaddr *)&sin, sizeof(sin)) < 0) {
- sin.sin_port = 0;
- if (bind(fd, (struct sockaddr *)&sin, sizeof(sin)) < 0) {
- perror("bind");
- exit(1);
- }
+ sin.sin_port = 0;
+ if (bind(fd, (struct sockaddr *)&sin, sizeof(sin)) < 0) {
+ perror("bind");
+ exit(1);
+ }
}
memset((char *)&sin, 0, sizeof(sin));
@@ -534,10 +534,10 @@
sin.sin_port = port;
sin.sin_addr.s_addr = addri;
-/* Got rid of connect and vic then uses sin in the sendto() function in
- * the dosend() method
- *
- */ if (connect(fd, (struct sockaddr *)&sin, sizeof(sin)) < 0) {
+ /* Connect() is useful for localname() call to find the iface addr being used
+ * Because of a problem with OSX we disconnect this socket once localname() has
+ * found out the ip address of the interface */
+ if (connect(fd, (struct sockaddr *)&sin, sizeof(sin)) < 0) {
perror("connect");
exit(1);
}
More information about the Sumover-dev
mailing list