Re: Socket communications
Re: Socket communications
- Subject: Re: Socket communications
- From: Andrew Farmer <email@hidden>
- Date: Wed, 8 Aug 2007 17:12:02 -0700
On 08 Aug 07, at 16:41, Maryanna Rogers wrote:
I've got two simple applications that I'm trying to get to talk over a
socket. After much digging, it appears relatively straightforward.
Sadly, I can't get the client to connect. ("a.b.c.d" is the ip of the
server).
The server does this:
<...>
addr.sin_port = 3421;
<...>
First of all, you need to apply htons() to sin_port, or it'll end up
using port 23821 on Intel machines. (3421 = 0x0d5d, 0x5d0d = 23821.
Byte ordering strikes again!)
Also, you may have an easier time working with NSStream/CFStream. See
this forum thread for a brief overview:
http://www.mackb.com/Uwe/Forum.aspx/programming/2158/Sockets-in-Cocoa
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden