#include "common.h"
typedef struct nodeData_t nodeData;
int listenerThread(struct nodeData* nodeData) {
SOCKET listenSocket;
if(!createSocket(listenSocket))
{
WSACleanup();
exit(-1);
}
// bind socket to port
if(!bindSocket(listenSocket,nodeData->/* this is where it doesnt compile */)){
closesocket(listenSocket);
WSACleanup();
exit(-1);
}
}
void main(int argc,char* argv[]) {
/* struct to hold the node's neighbors */
struct neighbor {
char *ip;
unsigned short port;
int cost;
};
/* struct to hold the node's data.
the threads are going to change some of these fields constantly */
struct nodeData {
int procid;
unsigned short localport;
DWORD LIFETIME;
DWORD HELLOTIMEOUT;
DWORD MAXTIME;
} nodeData;
free(neighbors);
exit(0);
}