More message port work.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@21986 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
CaS 2005-11-11 10:07:03 +00:00
parent e848a285c4
commit 50969bf11d
4 changed files with 41 additions and 13 deletions

View file

@ -1,3 +1,21 @@
2005-11-11 Richard Frith-Macdonald <rfm@gnu.org>
* Source/win32/NSMessagePortNameServerWin32.m: fix port lookup in case
where named port does not exist. Correct debug logging by class name.
* Testing/nsconnection_client.m: don't run large structure test on
mingw32 at present ... it crashes (something wrong with the invocation
stuff for ffcall and some large structures on mingw32)
2005-11-10 Richard Frith-Macdonald <rfm@gnu.org>
* Source/win32/NSMessagePortWin32.m: more changes
* Source/win32/NSMessagePortNameServerWin32.m: ditto
Working at least in part (pre-alpha I guess) ... enable with the
GSMailslot user default. Known problems -
1. no way of telling if the other end of a connection has gone until
we try to write to it.
2. hangup in my testing comms between three threads.
2005-11-09 Richard Frith-Macdonald <rfm@gnu.org>
* Source/win32/NSMessagePortWin32.m: more changes

View file

@ -206,19 +206,27 @@ static void clean_up_names(void)
{
NSString *n;
NSDebugLLog(@"NSMessagePort", @"portForName: %@ host: %@", name, host);
NSDebugLLog(@"NSMessagePortNameServer",
@"portForName: %@ host: %@", name, host);
if ([host length] && ![host isEqual: @"*"])
{
NSDebugLLog(@"NSMessagePort", @"non-local host");
NSDebugLLog(@"NSMessagePortNameServer", @"non-local host");
return nil;
}
n = [[self class] _query: name];
NSDebugLLog(@"NSMessagePort", @"got %@", n);
if (n == nil)
{
NSDebugLLog(@"NSMessagePortNameServer", @"got no port for %@", name);
return nil;
}
else
{
NSDebugLLog(@"NSMessagePortNameServer", @"got %@ for %@", n, name);
return AUTORELEASE([NSMessagePort newWithName: n]);
}
}
- (BOOL) registerPort: (NSPort *)port
forName: (NSString *)name
@ -227,7 +235,7 @@ static void clean_up_names(void)
NSString *n;
int rc;
NSDebugLLog(@"NSMessagePort", @"register %@ as %@\n", port, name);
NSDebugLLog(@"NSMessagePortNameServer", @"register %@ as %@\n", port, name);
if ([port isKindOfClass: [NSMessagePort class]] == NO)
{
[NSException raise: NSInvalidArgumentException
@ -238,7 +246,7 @@ static void clean_up_names(void)
if ([[self class] _query: name] != nil)
{
NSDebugLLog(@"NSMessagePort", @"fail, is a live port");
NSDebugLLog(@"NSMessagePortNameServer", @"fail, is a live port");
return NO;
}
@ -286,7 +294,7 @@ static void clean_up_names(void)
NSString *n;
int rc;
NSDebugLLog(@"NSMessagePort", @"removePortForName: %@", name);
NSDebugLLog(@"NSMessagePortNameServer", @"removePortForName: %@", name);
n = [[self class] _translate: name];
rc = RegDeleteValueW(key, UNISTR(n));
@ -309,7 +317,7 @@ static void clean_up_names(void)
NSMutableArray *a;
int i;
NSDebugLLog(@"NSMessagePort", @"removePort: %@", port);
NSDebugLLog(@"NSMessagePortNameServer", @"removePort: %@", port);
[serverLock lock];
a = NSMapGet(portToNamesMap, port);
@ -327,7 +335,8 @@ static void clean_up_names(void)
- (BOOL) removePort: (NSPort*)port forName: (NSString*)name
{
NSDebugLLog(@"NSMessagePort", @"removePort: %@ forName: %@", port, name);
NSDebugLLog(@"NSMessagePortNameServer",
@"removePort: %@ forName: %@", port, name);
if ([self portForName: name onHost: @""] == port)
{

View file

@ -772,8 +772,6 @@ static unsigned wordAlign;
M_LOCK(this->lock);
retry:
if (this->wData != nil)
{
/*
@ -830,7 +828,7 @@ retry:
{
NSDebugMLLog(@"NSMessagePort", @"Write of %d performs %d",
[this->wData length] - this->wLength, this->wSize);
goto retry;
SetEvent(this->wEvent);
}
else if ((errno = GetLastError()) != ERROR_IO_PENDING)
{

View file

@ -211,6 +211,7 @@ int con_data (id prx)
printf(" got %x\n", small.z);
[pool release];
#if !defined(__MINGW32__)
pool = [NSAutoreleasePool new];
printf("Struct:\n");
printf(" sending c='%c',d=%g,i=%d,s=%s,l=%ld",
@ -224,6 +225,7 @@ int con_data (id prx)
printf(" got c='%c',d=%g,i=%d,s=%s,l=%ld\n",
ffoo.c, ffoo.d, ffoo.i, ffoo.s, ffoo.l);
[pool release];
#endif
pool = [NSAutoreleasePool new];
printf("Object:\n");
@ -511,6 +513,7 @@ int main (int argc, char *argv[], char **env)
auth = [Auth new];
GSDebugAllocationActive(YES);
setvbuf(stdout, 0, _IONBF, 0);
debug = 0;
type_test = 0;
stats = 0;