OS X Asynchronous TCP/IP Problem
OS X Asynchronous TCP/IP Problem
- Subject: OS X Asynchronous TCP/IP Problem
- From: Michael Paluszek <email@hidden>
- Date: Thu, 14 Feb 2002 17:12:26 -0500
I have an application which uses asynchronous TCP/IP. The application is
Carbonized. What I am trying to do is listen on one endpoint for a
connection request, then connect another endpoint to transfer data. This
works fine on 9.2 but has problems on OS X
I've excerpted the code below.
The application starts by creating two endpoints on Port 5000 using the
following code:
OTInitInetAddress( &reqsin, (InetPort)port, kOTAnyInetAddress );
OTNotifyUPP theHandler = NewOTNotifyUPP(EventHandler);
gCookie = NULL;
err = OTAsyncOpenEndpointInContext( OTCreateConfiguration("tcp"), 0, &info,
theHandler, 0, NULL );
endpoint[k] = gCookie;
k is an index to the endpoint. We bind endpoint[0] but not endpoint[1]. Both
endpoints are created without any errors.
I then run the application and Socket Sifter (on a different machine) and
attempt to connect Socket Sifter to the application. Socket Sifter gets a
connection. The application gets a T_LISTEN and jumps into the notifier.
pascal void EventHandler( void*, OTEventCode event, OTResult result, void*
cookie )
case T_LISTEN:
ep = (TEndpoint *)cookie;
ep->Accept( endpoint[1], &mycall );
On OS X cookie is nil while on OS 9.2 I get cookie equal to endpoint[0]. On
OS 9.2 the application then sends out data on endpoint[1] while on OS X it
can't send any data.
When the application quits, Socket Sifter gets a disconnect, as it should.
I tried replacing the line above with
endpoint[0]->Accept( endpoint[1], &mycall );
knowing that the request should be coming in on endpoint[0], but that
doesn't work either on OS X.
Does anyone have any suggestions on why this doesn't work on OS X?
Thanks!
Sincerely,
Mike
-------
Michael A. Paluszek
Princeton Satellite Systems, Inc.
33 Witherspoon Street
Princeton, New Jersey 08542-3207
USA
Telephone: (609) 279-9606
Fax: (609) 279-9607
URL:
http://www.psatellite.com
_______________________________________________
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.