#include <OpenTransportProviders.h>
#include <OpenTptInternet.h>
#endif
-#if TARGET_CARBON
+#if TARGET_CARBON && !defined(OTAssert)
#define OTAssert( str , cond ) /* does not exists in Carbon */
#endif
#endif
InetSvcRef gInetSvcRef = 0 ;
int gOTInited = 0 ;
+OTNotifyUPP gOTNotifierUPP = NULL ;
OSStatus DoNegotiateIPReuseAddrOption(EndpointRef ep, Boolean enableReuseIPMode);
junk = OTSetBlocking(ep);
OTAssert("SetDefaultEndpointModes: Could not set blocking", junk == noErr);
*/
- junk = OTInstallNotifier(ep, OTInetEventHandler, data);
+ junk = OTInstallNotifier(ep, gOTNotifierUPP, data);
OTAssert("SetDefaultEndpointModes: Could not install notifier", junk == noErr);
/*
junk = OTUseSyncIdleEvents(ep, true);
OTAssert("Could not open Inet Services", err == noErr);
return FALSE ;
}
+ gOTNotifierUPP = NewOTNotifyUPP( OTInetEventHandler ) ;
return TRUE ;
}
#else
CloseOpenTransport() ;
#endif
+ if ( gOTNotifierUPP )
+ DisposeOTNotifyUPP( gOTNotifierUPP ) ;
}
}
OTByteCount sz = 0 ;
OTCountDataBytes( socket->m_endpoint , &sz ) ;
- if ( size > sz )
+ if ( size > (int)sz )
size = sz ;
res = OTRcv( socket->m_endpoint , buffer , size , &flags ) ;
if ( res < 0 )
GSocketError GAddress_INET_SetPortName(GAddress *address, const char *port,
const char *protocol)
{
- int i ;
+ size_t i ;
assert(address != NULL);
CHECK_ADDRESS(address, INET, GSOCK_INVADDR);