Server is multithreaded, but no connection is visible
UDPNetworkUtility and ConfigUtility are now using the ServiceLocator pattern in the server, and networkQueue() is running in a separate thread in the server. However, there seems to be a problem somewhere, since the broadcast request & response are not producing any visible output.
This commit is contained in:
@@ -7,12 +7,19 @@
|
||||
|
||||
#include <deque>
|
||||
|
||||
#ifdef DEBUG
|
||||
#include <iostream>
|
||||
#endif
|
||||
|
||||
static SDL_sem* lock = SDL_CreateSemaphore(1);
|
||||
|
||||
static std::deque<Packet> queue;
|
||||
|
||||
int networkQueue(void*) {
|
||||
UDPNetworkUtility* netUtil = ServiceLocator<UDPNetworkUtility>::Get();
|
||||
#ifdef DEBUG
|
||||
std::cout << "int networkQueue(void*) active" << std::endl;
|
||||
#endif
|
||||
for(;;) {
|
||||
SDL_SemWait(lock);
|
||||
while(netUtil->Receive()) {
|
||||
|
||||
Reference in New Issue
Block a user