• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Network communication with NSFileHandle & NSSocketPort
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Network communication with NSFileHandle & NSSocketPort


  • Subject: Network communication with NSFileHandle & NSSocketPort
  • From: "Valentin Dan" <email@hidden>
  • Date: Wed, 19 Mar 2008 05:58:06 -0400
  • Thread-topic: Network communication with NSFileHandle & NSSocketPort


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@hidden"email@hidden                 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 (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

  • Follow-Ups:
    • Re: Network communication with NSFileHandle & NSSocketPort
      • From: Jeff LaMarche <email@hidden>
    • Re: Network communication with NSFileHandle & NSSocketPort
      • From: Andrew Farmer <email@hidden>
  • Prev by Date: Re: How to debug this Tiger release error?
  • Next by Date: Re: Adding spaces to an NSString
  • Previous by thread: outlineview
  • Next by thread: Re: Network communication with NSFileHandle & NSSocketPort
  • Index(es):
    • Date
    • Thread