Force use of a socket port name server to look up servers on other hosts.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/steptalk/trunk@38151 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Wolfgang Lux 2014-11-02 22:11:55 +00:00
parent 78991ff299
commit c3b1467afe
2 changed files with 22 additions and 10 deletions

View file

@ -1,6 +1,11 @@
2014-11-02 Wolfgang Lux <wolfgang.lux@gmail.com>
* Frameworks/StepTalk/STRemoteConversation.m (connectionDidDie:):
* Frameworks/StepTalk/STRemoteConversation.m (-open): Force use of
a socket port name server to look up servers on other hosts.
2014-11-02 Wolfgang Lux <wolfgang.lux@gmail.com>
* Frameworks/StepTalk/STRemoteConversation.m (-connectionDidDie:):
Fix leak of the proxy and environmentProcess attributes when a
connection died.

View file

@ -6,6 +6,7 @@
#import <Foundation/NSNotification.h>
#import <Foundation/NSConnection.h>
#import <Foundation/NSDistantObject.h>
#import <Foundation/NSPortNameServer.h>
#import "STEnvironment.h"
@ -34,8 +35,9 @@
- (void)open
{
NSString *envProcName;
NSPortNameServer *nameServer;
if(connection)
if (connection)
{
[NSException raise:@"STConversationException"
format:@"Unable to open conversation: already opened."];
@ -45,12 +47,17 @@
envProcName = [NSString stringWithFormat:@"STEnvironment:%@",
environmentName];
if ([hostName length] > 0)
nameServer = [NSSocketPortNameServer sharedInstance];
else
nameServer = [NSPortNameServer systemDefaultPortNameServer];
connection = [NSConnection connectionWithRegisteredName:envProcName
host:hostName];
host:hostName
usingNameServer:nameServer];
RETAIN(connection);
if(!connection)
if (!connection)
{
[NSException raise:@"STConversationException"
format:@"Connection failed for environment '%@'",