• 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
Test for TCP port
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Test for TCP port


  • Subject: Test for TCP port
  • From: "Heizer, Charles" <email@hidden>
  • Date: Fri, 08 Apr 2011 15:26:22 -0700
  • Acceptlanguage: en-US
  • Thread-topic: Test for TCP port

Hello,
What is the best way to test to see if a TCP port is reachable and will answer connections? I was trying to use NSSocketPort and NSConnection but I'm not getting a valid connection.

Thanks,
Charles


NSSocketPort *sendPort = [[NSSocketPort alloc] initRemoteWithTCPPort:3600 host:@"test.myhost.com<http://test.myhost.com>"];
NSConnection *connection = [NSConnection connectionWithReceivePort:nil sendPort:sendPort];


[connection setRequestTimeout:10.0];
[connection setReplyTimeout:10.0];


NSLog(@"theConnection 0x%X", connection);
NSLog(@"Connect is valid? %d", (int)[connection isValid]);
_______________________________________________

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: Test for TCP port
      • From: Dave Carrigan <email@hidden>
    • Re: Test for TCP port
      • From: Sherm Pendley <email@hidden>
    • Re: Test for TCP port
      • From: Kyle Sluder <email@hidden>
  • Prev by Date: Re: Display a "Red frame" on the screen
  • Next by Date: Re: Test for TCP port
  • Previous by thread: Re: Framework Installation Directory
  • Next by thread: Re: Test for TCP port
  • Index(es):
    • Date
    • Thread