Networking and threading
Networking and threading
- Subject: Networking and threading
- From: Denis Defreyne <email@hidden>
- Date: Sun, 14 Mar 2004 20:59:52 +0100
Hello list.
I am writing a chat client and that obviously involves writing network
code.
However, I'm running into trouble. I first wrote the network code using
NSFileHandle's, and connecting to servers using connect(). Since
connect() blocks, I had to put the connect() in a separate thread
(using pthreads), but that caused more problems, since a running
pthread is difficult, if not impossible, to stop.
I switched to NetSocket, which is based on the CoreFoundation CFSocket
stuff. But, CFSocketConnectToAddress seems to be buggy; connecting to
closed ports apparently makes the socket connected, and immediately
after that, disconnected. I guess it's an Apple bug. It's not just a
NetSocket issue, it happens with other CFSocket-based frameworks as
well.
I'm wanting to try the OmniNetworking framework. This framework does
not support async I/O so I'm going to use threads anyway if I use
OmniNetworking.
My question is, is OmniNetworking good? Should I use another networking
framework? If I have to implement some threading, what thread framework
would you recommend?
Regards,
Denis Defreyne
--
mail: email@hidden
web:
http://amonre.bedesign.be/
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.