/*
- Copyright (C) 2000-2004 SKYRIX Software AG
+ Copyright (C) 2000-2005 SKYRIX Software AG
- This file is part of OpenGroupware.org.
+ This file is part of SOPE.
- OGo is free software; you can redistribute it and/or modify it under
+ SOPE is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
- OGo is distributed in the hope that it will be useful, but WITHOUT ANY
+ SOPE is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public
- License along with OGo; see the file COPYING. If not, write to the
+ License along with SOPE; see the file COPYING. If not, write to the
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
-// $Id$
#include "SNSConnection.h"
#include <NGObjWeb/WOApplication.h>
#include <NGObjWeb/WOAdaptor.h>
#include <NGObjWeb/WOSession.h>
+#include <NGStreams/NGStreams.h>
+#include <NGStreams/NGNet.h>
#include "common.h"
#if !LIB_FOUNDATION_LIBRARY
sns = NGSocketAddressFromString([ud stringForKey:@"SNSPort"]);
if (sns == nil) {
- NSLog(@"ERROR(%s): Could not create socket address for snsd(port=%@).",
- __PRETTY_FUNCTION__, sns);
+ [self errorWithFormat:
+ @"(%s): Could not create socket address for snsd(port=%@).",
+ __PRETTY_FUNCTION__, sns];
RELEASE(self);
return;
}
#endif
if (![self->socket isConnected]) {
- NSLog(@"ERROR: Could not connect socket %@ to snsd (port=%@), "
- @"terminating: %@", self->socket, sns, [self->socket lastException]);
+ [self errorWithFormat:@"Could not connect socket %@ to snsd (port=%@), "
+ @"terminating: %@",
+ self->socket, sns, [self->socket lastException]];
ASSIGN(self->socket, (id)nil);
RELEASE(self);
[[WOApplication application] terminate];
NS_ENDHANDLER;
if (self->socket == nil) {
- NSLog(@"ERROR: Could not register with snsd (port=%@).", sns);
+ [self errorWithFormat:@"Could not register with snsd (port=%@).", sns];
RELEASE(self);
return;
}
}
- (void)lostConnectionToNameServer:(NSException *)_exception {
- NSLog(@"ERROR: application lost connection to snsd: %@", _exception);
+ [self errorWithFormat:@"application lost connection to snsd: %@", _exception];
[[WOApplication application] terminate];
}
- (void)lostConnectionToNameServer {