• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: OT Notifier
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: OT Notifier


  • Subject: Re: OT Notifier
  • From: Michael Paluszek <email@hidden>
  • Date: Thu, 21 Feb 2002 10:29:20 -0500

Thanks for the help! The OT code now works properly on OS 9.x and OS X. I
created:

typedef struct
{
SInt32 endpointID; // endpoint id number
} EndpointInfo;

and the declared as a global.

EndpointInfo *endpointInfo[8];

When I create my endpoint I now do

Boolean SetupSocket( int k, long port )

endpointInfo[k] = new EndpointInfo;
endpointInfo[k]->endpointID = k;


err = OTAsyncOpenEndpointInContext( OTCreateConfiguration(kTCPName), 0,
&info, theHandler, endpointInfo[k], NULL );

and in the notifier

static pascal void EventHandler( void* context, OTEventCode event, OTResult
result, void* cookie )
{
TCall mycall;
InetAddress caddr;
TEndpoint *ep;
OSStatus err;
int kSc;

// Endpoint information
EndpointInfo* endpointInfo = (EndpointInfo*) context;


case T_DATA:
kSc = endpointInfo->endpointID; // Identifies the spacecraft

if( (kSc > 0) && (kSc <= gNSpacecraft) )
{
if( !monitorModeOn )
{
ReadIncomingData( kSc );
}
else
{
ReadMonitorData( kSc );
}
}
break;

This appears to work reliably on all machines tested.

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.

References: 
 >Re: OT Notifier (From: Anders Pytte <email@hidden>)

  • Prev by Date: Re: OT Notifier
  • Next by Date: Re(2): TCP/IP Loopback
  • Previous by thread: Re: OT Notifier
  • Next by thread: Re: OT Notifier
  • Index(es):
    • Date
    • Thread