Hi,

 

I need to send and receive message over the network but I got stuck …

 

I have the following code 

 

…

 

unsigned short serverPort = 9000;

NSString * serverAddress = @“192.1.2.1”;

 

NSSocketPort * socketPort =  [[NSSocketPort alloc] 
initRemoteWithTCPPort:serverPort host:serverAddress];

 

…

 

The problem is that [socketPort socket] always returns -1. (The server is 
running & accepting connections on that port). Using htons(serverPort) makes no 
difference.

 

Any ideas; or maybe there’s a better way than using NSFileHandle & NSSocketPort 
? 

 

___________________________________________________________________

Valentin Dan, Software Developer                 Direct: +1 905 886 1833 
ext.3047               

Email: HYPERLINK "mailto:[EMAIL PROTECTED]"[EMAIL PROTECTED]                 
Office: +40 356-710158

Masstech Group Inc.                              Fax:    +40 256-220912

HYPERLINK "http://www.masstechgroup.com/"http://www.masstechgroup.com 

 

THIS MESSAGE IS INTENDED ONLY FOR THE ADDRESSEE. IT MAY CONTAIN PRIVILEGED OR 
CONFIDENTIAL INFORMATION.ANY UNAUTHORIZED DISCLOSURE IS STRICTLY PROHIBITED.IF 
YOU HAVE RECEIVED THIS MESSAGE IN ERROR, PLEASE NOTIFY US IMMEDIATELY SO THAT 
WE MAY CORRECT THE RECORDS. PLEASE THEN DELETE THE ORIGINAL MESSAGE. THANK YOU.

 

 

 


No virus found in this outgoing message.
Checked by AVG. 
Version: 7.5.519 / Virus Database: 269.21.7/1334 - Release Date: 18.03.2008 
20:52
 
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to