Browse Source

use default port

master
philipp schoenberger 10 years ago
parent
commit
5f0c9254ea
  1. 2
      lwrserv/Makefile
  2. 7
      lwrserv/SvrHandling.cpp
  3. 4
      lwrserv/SvrHandling.h
  4. 2
      lwrserv/program.cpp

2
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] $@"

7
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);

4
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();

2
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;
}
Loading…
Cancel
Save