Problems with CFSocket and CFStream
Problems with CFSocket and CFStream
- Subject: Problems with CFSocket and CFStream
- From: Martin Bestmann <email@hidden>
- Date: Tue, 18 Nov 2003 17:24:03 +0100
Hi,
We have a couple of problems with CFSocket and CFStream.
Here is what we do.
- Listening on a port using CFSocketCreateWithSocketSignature
- Connection request comes in
- In the Callback function of CFSocketCreateWithSocketSignature we are
doing the following
- CFStreamCreatePairWithSocket with the CFSocketNativeHandle
-
CFReadStreamSetProperty(xReadStream,kCFStreamPropertyShouldCloseNativeSo
cket,kCFBooleanTrue)
- CFReadStreamOpen and CFWriteStreamOpen
We do receive data correctly on the stream. So the stream is open and
working.
Here are the problems.
1)
CFReadStreamCopyProperty(xReadStream,kCFStreamPropertyShouldCloseNativeS
ocket) returns always NULL
2)
CFReadStreamCopyProperty(xReadStream,kCFStreamPropertySocketRemoteHostNa
me) returns always NULL
3) After closing the streams with CFReadStreamClose and
CFWriteStreamClose and also closing the socket with CFSocketInvalidate
and quitting app on next launch of the app (within the next few
seconds) we get an error when calling CFSocketCreateWithSocketSignature
because of the fact that the system for some reason things that the
socket is still occupied.
This is all on OS X 10.3 7B85 (same happens on 10.2.6 6L60).
We probably doing something wrong here.
Martin
------------------------------------------------------------------------
-----------------------
Martin Bestmann Netopia
Development GmbH
Phone: +49-9134-9942-0 Weingasse 26
Fax: +49-9134-997911 91077 Neunkirchen am
Brand
e-mail:email@hidden Germany
_______________________________________________
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.