From 5f0c9254ea3e6970e2cd5127be29d82fc76d548a Mon Sep 17 00:00:00 2001 From: philipp schoenberger Date: Tue, 9 Jun 2015 11:16:27 +0200 Subject: [PATCH] use default port --- lwrserv/Makefile | 2 +- lwrserv/SvrHandling.cpp | 7 ++++++- lwrserv/SvrHandling.h | 4 +++- lwrserv/program.cpp | 2 +- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/lwrserv/Makefile b/lwrserv/Makefile index fbf6bf3..aa70f66 100755 --- a/lwrserv/Makefile +++ b/lwrserv/Makefile @@ -57,7 +57,7 @@ clean: $(BUILD_DIR)/$(OUT_BINARY): $(BUILD_DIR) $(DEPS) $(DEP_LIBS) $(OBJS) $(Q)echo " [ld] $@" - $(Q)( $(CC) $(CFLAGS) $(OBJS) $(LDFLAGS) -o $(OUT_BINARY)) || exit 1 + $(Q)( $(CC) $(CFLAGS) $(OBJS) $(LDFLAGS) -o $@ ) || exit 1 $(BUILD_DIR)/%.o : %.c $(BUILD_DIR) $(Q)echo " [CC] $@" diff --git a/lwrserv/SvrHandling.cpp b/lwrserv/SvrHandling.cpp index b2014e2..28b2b2b 100755 --- a/lwrserv/SvrHandling.cpp +++ b/lwrserv/SvrHandling.cpp @@ -354,6 +354,11 @@ SvrHandling::~SvrHandling() { } +void SvrHandling::run() +{ + this->run(SVR_DEFAULT_PORT); +} + void SvrHandling::run(int port) { cout << timestamp() + "Starting " << SVR_NAME << "\n"; @@ -404,7 +409,7 @@ bool SvrHandling::handshakeAccepted(SocketObject& client) { c_state = waiting; message = SVR_FAILED; - cout << timestamp() + "Handshake failed.\n"; + cout << timestamp() + "Handshake failed. " cout << "Invalid recv msg \'" << message <<"\'"; } client.Send(message); return(c_state == accepted); diff --git a/lwrserv/SvrHandling.h b/lwrserv/SvrHandling.h index fd852be..2dd6da0 100755 --- a/lwrserv/SvrHandling.h +++ b/lwrserv/SvrHandling.h @@ -53,7 +53,9 @@ public: SvrHandling(); //Destructor virtual ~SvrHandling(); - //Rund server @port + ///Run server with default port + void run(); + ///Run server special port void run(int port); //Get current timestamp std::string timestamp(); diff --git a/lwrserv/program.cpp b/lwrserv/program.cpp index 90a2d5b..b8a9e5b 100644 --- a/lwrserv/program.cpp +++ b/lwrserv/program.cpp @@ -514,7 +514,7 @@ int main() cerr << "Failed: could not create server \n" << endl; return -ENOMEM; } - svr->run(SVR_DEFAULT_PORT); + svr->run(); return 0; }