mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-05 22:20:59 +00:00
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:
parent
e848a285c4
commit
50969bf11d
4 changed files with 41 additions and 13 deletions
18
ChangeLog
18
ChangeLog
|
@ -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
|
||||
|
|
|
@ -206,18 +206,26 @@ 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);
|
||||
return AUTORELEASE([NSMessagePort newWithName: 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
|
||||
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue