Missing T_GODATA event in carbonized OT App
Missing T_GODATA event in carbonized OT App
- Subject: Missing T_GODATA event in carbonized OT App
- From: Reto Gähler <email@hidden>
- Date: Thu, 21 Mar 2002 13:18:22 +0100
Hi
I'm carbonizing an application which uses OT tcp endpoints in asynchronous
blocking mode. Since I run the carbonized code under MacOS X, the notifier
is not always called with the T_GODATA event as it was under MacOS 9.
I have an established client-server connection and the client sends a
request. The server gets the T_DATA event, reads the request and starts to
send data back to the client within the notifier. The server calls OTSnd
until kOTFlowErr is returned and leaves the notifier. The client gets T_DATA
events and consumes all data which were sent by the server, but the server
does never get a T_GODATA event for the remaining data.
Simplified code:
static void TCPReadData() {
res = OTRcv();
if (res >= 0) {
//process data
TCPReadData(); //recursive call
}
if (res != kOTNoDataErr) {
//handle error
}
if (clientRequestReceived) TCPWriteData();
}
static void TCPWriteData() {
res = OTSnd();
if (res >= 0 && moreDataToSend) {
TCPWriteData(); //recursive call
}
if (res != kOTFlowErr) {
//handle error
}
}
static pascal void Notifier() {
OTEnterNotifier();
switch(event) {
case T_DATA:
TCPReadData();
break;
case T_GODATA:
TCPWriteData();
break;
}
OTLeaveNotifier();
}
Does anybody have an idea, why I don't get the T_GODATA event?
Thanks, Reto
_______________________________________________
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.