Added auto-discovery of LAN servers using UDP broadcast. (for now the client must press the A key from the join menu to trigger this)

This commit is contained in:
Mark Vejvoda
2010-04-01 06:31:10 +00:00
parent 5ecc84099a
commit 0bcb710606
13 changed files with 515 additions and 13 deletions

View File

@@ -1,7 +1,7 @@
// ==============================================================
// This file is part of Glest Shared Library (www.glest.org)
//
// Copyright (C) 2001-2008 Marti<EFBFBD>o Figueroa
// Copyright (C) 2001-2008 Martio Figueroa
//
// You can redistribute this code and/or modify it under
// the terms of the GNU General Public License as published
@@ -101,6 +101,7 @@ public:
// =====================================================
// Misc
// =====================================================
void Tokenize(const string& str,vector<string>& tokens,const string& delimiters = " ");
bool isdir(const char *path);
void findDirs(const vector<string> &paths, vector<string> &results, bool errorOnNotFound=false);
void findAll(const vector<string> &paths, const string &fileFilter, vector<string> &results, bool cutExtension=false, bool errorOnNotFound=true);

View File

@@ -103,10 +103,15 @@ public:
// =====================================================
class ServerSocket: public Socket{
public:
void bind(int port);
void listen(int connectionQueueSize= SOMAXCONN);
Socket *accept();
protected:
void broadcast_thread();
};
}}//end namespace