#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 ) ;
}
}
*/
GSocketError GSocket_SetServer(GSocket *sck)
{
- int type;
- int arg = 1;
-
assert(sck != NULL);
/* must not be in use */
GSocket *GSocket_WaitConnection(GSocket *socket)
{
GSocket *connection = NULL ;
- GSocketError err;
-
- int arg = 1;
assert(socket != NULL);
*/
GSocketError GSocket_SetNonOriented(GSocket *sck)
{
- int arg = 1;
-
assert(sck != NULL);
if (sck->m_endpoint != kOTInvalidEndpointRef )
*/
GSocketError GSocket_Connect(GSocket *sck, GSocketStream stream)
{
- int ret;
- int arg = 1;
InetAddress addr ;
TEndpointInfo info;
- OTFlags flags = 0;
- OSStatus err = kOTNoError;
+ OSStatus err = kOTNoError;
TCall peer ;
assert(sck != NULL);
*/
GSocketEventFlags GSocket_Select(GSocket *socket, GSocketEventFlags flags)
{
- OTResult state ;
assert(socket != NULL);
wxMacProcessNotifierEvents() ;
/*
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_SetHostAddress(GAddress *address,
unsigned long hostaddr)
{
- struct in_addr *addr;
-
assert(address != NULL);
CHECK_ADDRESS(address, INET, GSOCK_INVADDR);
GSocketError GAddress_INET_SetPortName(GAddress *address, const char *port,
const char *protocol)
{
- InetAddress *addr;
- int i ;
+ size_t i ;
assert(address != NULL);
CHECK_ADDRESS(address, INET, GSOCK_INVADDR);
GSocketError GAddress_INET_SetPort(GAddress *address, unsigned short port)
{
- InetAddress *addr;
-
assert(address != NULL);
CHECK_ADDRESS(address, INET, GSOCK_INVADDR);
address->m_port = port ;
/* Hack added for Mac OS X */
GSocketError GAddress_UNIX_GetPath(GAddress *addr, char *path, size_t buf)
{
+ return GSOCK_INVADDR;
}
GSocketError GAddress_UNIX_SetPath(GAddress *addr, const char *path)
{
+ return GSOCK_INVADDR;
}
#endif /* wxUSE_SOCKETS || defined(__GSOCKET_STANDALONE__) */