gert@uvabick.UUCP (Gert Hulstein) (07/20/89)
I just started playing with MacTCP and found that the first call to
PBOpen for the ".ipp" driver takes a long time (>30 secs) with lots
of Disk access. This hapens every time After the machine is restarted.
Anybody know what it's doing, and how to avoid it ?
Gert Hulstein, University of Amsterdam.
gert@uvabick.uucp
Below a MPW Code segment that I used :
#include <Files.h>
#include <Devices.h>
#include "MacTCPCommonTypes.h"
#include "TCPPB.h"
#include "AddressXlation.h"
#include "GetMyIPAddr.h"
short gIPPDriverRefNum;
OSErr _TCPInit()
{
auto ParamBlockRec pb;
auto OSErr osErr;
pb.ioParam.ioCompletion = 0;
pb.ioParam.ioNamePtr = "\p.ipp";
pb.ioParam.ioPermssn = fsCurPerm;
osErr = PBOpen( &pb, false );
if ( noErr == osErr ) {
gIPPDriverRefNum = pb.ioParam.ioRefNum;
}
return osErr;
}
OSErr _TCPGetIP(pb, ip, netMask, ioCompletion, async)
struct IPParamBlock *pb;
ip_addr *ip;
long *netMask;
ProcPtr ioCompletion;
Boolean async;
{
auto OSErr osErr;
pb->ioCompletion = ioCompletion;
pb->ioCRefNum = gIPPDriverRefNum;
pb->csCode = ipctlGetAddr;
osErr = PBControl((ParmBlkPtr) pb, async);
if (!async && (noErr == osErr)) {
*ip = pb->ourAddress;
*netMask = pb->ourNetMask;
}
return osErr;
}
main()
{ struct IPParamBlock myPB;
ip_addr myIP;
long myNetMask;
if ( _TCPInit() == noErr ) {
if ( _TCPGetIP( &myPB, &myIP, &myNetMask, 0, false ) == noErr ) {
printf( "addr = %lo\n", myIP );
}
else
printf( "YikesI\n" );
}
else
printf( "WhoopsI\n" );
}mahan@zaphod.ncsa.uiuc.edu (07/21/89)
You might want to grab the source for NCSA Telnet 2.3, which has a working MacTCP driver support in it. Available from ftp.ncsa.uiuc.edu ( 128.174.20.50 )