• 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
Re: Help with CFNetService/Echo example
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Help with CFNetService/Echo example


  • Subject: Re: Help with CFNetService/Echo example
  • From: Jeremy Wyld <email@hidden>
  • Date: Fri, 4 Oct 2002 09:14:04 -0700

Yes, I've got a bug in the sample code.

Add
dot++;

right after
// Create the name
name = CFStringCreateWithBytes(kCFAllocatorDefault,
nameAndDomain,
dot - nameAndDomain,
kCFStringEncodingUTF8,
FALSE);

It should work then.

jeremy

On Friday, October 4, 2002, at 07:55 AM, Justin Greenfield wrote:

Hi.. I'm a newbie to sockets and networking in general, so please forgive me if I ask something that's blatantly obvious to everyone else.. :-)

I'm trying to learn about CFSockets and CFNetServices and have been looking at the Echo and Echo Client examples in the Jaguar Developer Tools.

So I've got a couple of instances of the Echo server running, and when I run the Echo Client, it finds them both just fine.


[podunk:networking/echo client/build] justin% ./Echo\ Client
Hit Ctrl-C to stop the search...
podunk 1.local.
podunk.local.


Then, if I give one of those name+domains as the command line arg, it goes into ConnectAndUseService(), creates the service, schedules it with the run loop, resolves the service and runs the loop. But it never gets into the ServiceCallback() and never connects with the echo server I specified.

I watched the WWDC DVD with the session on this example, and added a line to print out the port # of the server. I can telnet to that port and the echo server works fine that way. But the WWDC session never touched on the Echo Client app.

What am I missing here? It must be something fairly obvious....

Justin
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • CFNetService - PB vs. CodeWarrior problems
      • From: Justin Greenfield <email@hidden>
References: 
 >Help with CFNetService/Echo example (From: Justin Greenfield <email@hidden>)

  • Prev by Date: Help with CFNetService/Echo example
  • Next by Date: BSD Sockets under Carbon
  • Previous by thread: Help with CFNetService/Echo example
  • Next by thread: CFNetService - PB vs. CodeWarrior problems
  • Index(es):
    • Date
    • Thread