OK, the reason reading data doesn't work is because you aren't waiting for the delegate calls to tell you that data is available; you're just opening the stream and then immediately trying to read. It takes time to open a socket and receive data over it.

You should really read the conceptual overview docs for Cocoa streams before going any further. They include snippets showing how the delegate calls work. Also, the sample code CocoaEcho shows how to write a TCP client app that connects to a server and receives data.

—Jens_______________________________________________

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 arch...@mail-archive.com

Reply via email to