Why send call crashes my App ?
Why send call crashes my App ?
- Subject: Why send call crashes my App ?
- From: Pranav Kumar Sahu <email@hidden>
- Date: Thu, 4 Sep 2003 19:13:44 +0530
Hi All,
I have an application that does Socket level calls. I am using
CFSocket for callback functionality with native socket. So I have an
write callback attached to CFSocket object. When ever client to my app sends
some request for document I do a register using following code :
CFSocketContext socketCtxt = {0,callinfoptr,NULL,NULL,NULL};
// callinfoptr contains my data which I need to send to my callback.
s = CFSocketCreateWithNative(NULL,socket,
kCFSocketWriteCallBack,dealWithSendSocket, &socketCtxt);
//socket is my native socket and "dealWithSendSocket" is my callback
function
source = CFSocketCreateRunLoopSource(NULL, s, 0);
CFRunLoopAddSource(CFRunLoopGetCurrent(), source,
kCFRunLoopDefaultMode);
CFSocketEnableCallBacks(s, kCFSocketWriteCallBack);
And when data available in socket I am getting the callback and I
call
bytestaken = send(callinfoptr->socket,
(char*)callinfoptr->buffer,
callinfoptr->bufferlength,0);
& it works fine.
Problem arises when client cancels upload in between. Some time it
crashes in the send call some times it does not call the callback at all
so my app waits for sending.
is this a known scenario ? Or I am doing something wrong. I have
tested with out CFSocket stuff. Just calls the send instead of
registering still it crashes when ever I call a send.
Any clue on what's happening ?
ThanX
Pranav Kumar Sahu
QUARK MEDIA
[demime 0.98b removed an attachment of type application/ms-tnef]
_______________________________________________
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.