Dear Saso,

Simple: you didn't replace sendto() with a call to write() - Linux
accepts this (it simply regards connect() as a 'default' send address,
and allows you to override it on a per-packet basis using sendto()),
whereas Solaris and OSX will complain that it is invalid to use sendto()
on a socket with a destination address already set using connect().

I don't have OSX to test exactly, but my Solaris 10 machine stopped
complaining after I replaced sendto() with write() and I think OSX will
shut up as well (seems to be the same error).

Yeapp! That was it!

I still had to fix a small bug in the receiver code to get it compiled:

      ...
      // join the multicast group using IGMP
      struct ip_mreq req;

      if (inet_aton(GROUP_IP, &req.imr_multiaddr.s_addr) == 0)
      {
         fprintf(stderr, "inet_aton() failed\n");
         exit(1);
      }
// req.imr_multiaddr = GROUP_IP; // imr_multiaddris of type in_addr
     req.imr_interface.s_addr = INADDR_ANY;
     ...

But this seems to work now. I run the receiver on Solaris and the sender on MacOSX and it worked!! I will now put all this in an Objective-C wrapper to make it ready for productive use! :-)

Thanks a lot for your help Saso!!!

Best wishes,

    Andreas



_______________________________________________
Discuss-gnustep mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/discuss-gnustep

Reply via email to