The mail did not reach the list because my apache alias was not subscribed, so 
here is a copy.
BTW, is there a way not to receive the mails while still being able to post ?


cdevienne 2004/08/13 01:50:28

Modified: . Makefile.am configure.in
src Makefile.am
Added: simplesocketserver Makefile.am simplesocketserver.cpp
Removed: src simplesocketserver.cpp
Log:
Moved simplesocketserver to a separate directory.
Having it in src made "make -j N" fail most of the time because is depends
on liblog4cxx which is constructed in src.
Revision Changes Path
1.9 +1 -1 logging-log4cxx/Makefile.am
Index: Makefile.am
===================================================================
RCS file: /home/cvs/logging-log4cxx/Makefile.am,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- Makefile.am 29 Jun 2004 13:09:17 -0000 1.8
+++ Makefile.am 13 Aug 2004 08:50:28 -0000 1.9
@@ -1,4 +1,4 @@
-SUBDIRS = docs src msvc include tests performance examples
+SUBDIRS = docs src msvc include simplesocketserver tests performance examples
EXTRA_DIST = autogen.sh license.apl
1.42 +1 -0 logging-log4cxx/configure.in
Index: configure.in
===================================================================
RCS file: /home/cvs/logging-log4cxx/configure.in,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -r1.41 -r1.42
--- configure.in 4 Jun 2004 17:42:57 -0000 1.41
+++ configure.in 13 Aug 2004 08:50:28 -0000 1.42
@@ -370,6 +370,7 @@
include/log4cxx/xml/Makefile
include/log4cxx/config/Makefile
include/log4cxx/db/Makefile
+simplesocketserver/Makefile
tests/Makefile
tests/input/Makefile
tests/input/xml/Makefile
1.1 logging-log4cxx/simplesocketserver/Makefile.am
Index: Makefile.am
===================================================================
INCLUDES = -I$(top_srcdir)/include
AM_CPPFLAGS = @CPPFLAGS_XML@ @CPPFLAGS_ODBC@
bin_PROGRAMS = simplesocketserver
simplesocketserver_SOURCES = simplesocketserver.cpp
simplesocketserver_LDADD = $(top_builddir)/src/liblog4cxx.la
1.1 logging-log4cxx/simplesocketserver/simplesocketserver.cpp
Index: simplesocketserver.cpp
===================================================================
/*
* Copyright 2003,2004 The Apache Software Foundation.
* * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* * http://www.apache.org/licenses/LICENSE-2.0
* * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <log4cxx/portability.h>
#ifdef WIN32
#include <windows.h>
#endif
#include <log4cxx/logger.h>
#include <log4cxx/helpers/serversocket.h>
#include <log4cxx/helpers/socket.h>
#include <log4cxx/net/socketnode.h>
#include <log4cxx/xml/domconfigurator.h>
#include <log4cxx/propertyconfigurator.h>
#include <log4cxx/helpers/thread.h>
#include <log4cxx/logmanager.h>
#include <log4cxx/level.h>
#include <log4cxx/helpers/stringhelper.h>
using namespace log4cxx;
#ifdef HAVE_XML
using namespace log4cxx::xml;
#endif
using namespace log4cxx::net;
using namespace log4cxx::helpers;
int port = 0;
void usage(const String& msg)
{
tcout << msg << std::endl;
tcout << _T("Usage: simpleocketServer port configFile") << std::endl;
}
void init(const String& portStr, const String& configFile)
{
USES_CONVERSION;
port = ttol(portStr.c_str());
#ifdef HAVE_XML
// tests if configFile ends with ".xml"
if (StringHelper::endsWith(configFile, _T(".xml")))
{
DOMConfigurator::configure(configFile);
} else
#endif
{
PropertyConfigurator::configure(configFile);
}
}
int main(int argc, char * argv[])
{
if(argc == 3)
{
USES_CONVERSION;
init(A2T(argv[1]), A2T(argv[2]));
}
else
{
USES_CONVERSION;
usage(_T("Wrong number of arguments."));
return 1;
}
try
{
LoggerPtr logger = Logger::getLogger(_T("SimpleSocketServer"));

LOG4CXX_INFO(logger, _T("Listening on port ") << port);

ServerSocket serverSocket(port);
while(true)
{
LOG4CXX_INFO(logger, _T("Waiting to accept a new client."));
SocketPtr socket = serverSocket.accept();

LOG4CXX_INFO(logger, _T("Connected to client at ")
<< socket->getInetAddress().toString());
LOG4CXX_INFO(logger, _T("Starting new socket node."));

Thread * thread = new Thread(new SocketNode(socket,
LogManager::getLoggerRepository()));
thread->start();
}
}
catch(SocketException& e)
{
tcout << _T("SocketException: ") << e.getMessage() << std::endl;
}
return 0;
}
1.16 +0 -6 logging-log4cxx/src/Makefile.am
Index: Makefile.am
===================================================================
RCS file: /home/cvs/logging-log4cxx/src/Makefile.am,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- Makefile.am 2 Apr 2004 08:48:29 -0000 1.15
+++ Makefile.am 13 Aug 2004 08:50:28 -0000 1.16
@@ -89,9 +89,3 @@
AM_CPPFLAGS = @CPPFLAGS_XML@ @CPPFLAGS_ODBC@
liblog4cxx_la_LDFLAGS = -version-info @LT_VERSION@ @LIBS_XML@ @LIBS_ODBC@
-bin_PROGRAMS = simplesocketserver
-simplesocketserver_SOURCES = simplesocketserver.cpp
-simplesocketserver_LDADD = $(top_builddir)/src/liblog4cxx.la
-
-
-





Reply via email to