static void Main(string[] args) { beacon = new Beacon(); MessageQueue beaconInputMQ = MSMQHelper.CreateMessageQueue(GlobalVariables.BEACON_INPUT_QUEUE_NAME); beaconInputMQ.ReceiveCompleted += BeaconInputReaceived; beaconInputMQ.BeginReceive(); Console.ReadKey(); }
public LoadBalancer() { databaseConsumerQueue = MSMQHelper.CreateMessageQueue(GlobalVariables.MYSQL_PLAYER_DB_CONSUMER_QUEUE_NAME); databaseProducerQueue = MSMQHelper.CreateMessageQueue(GlobalVariables.MYSQL_PLAYER_DB_PRODUCER_QUEUE_NAME); databaseProducerQueue.ReceiveCompleted += DatabaseProducerQueue_ReceiveCompleted; databaseProducerQueue.BeginReceive(); listener = new TcpListener(IPAddress.Any, GlobalVariables.GAME_DATABASE_LOADBALANCER_PORT); listener.Start(); Thread t = new Thread(() => ListenForConnections()); t.IsBackground = true; t.Start(); }
static void Main() { databaseRequestQueue = MSMQHelper.CreateMessageQueue(GlobalVariables.CONSUMER_QUEUE_NAME); databaseResponseQueue = MSMQHelper.CreateMessageQueue(GlobalVariables.PRODUCER_QUEUE_NAME); tokenRequestQueue = MSMQHelper.CreateMessageQueue(GlobalVariables.TOKEN_INPUT_QUEUE_NAME); tokenResponseQueue = MSMQHelper.CreateMessageQueue(GlobalVariables.TOKEN_RESPONSE_QUEUE_NAME); databaseRequestQueue.Purge(); databaseResponseQueue.Purge(); tokenRequestQueue.Purge(); tokenResponseQueue.Purge(); // Start Listen for Clients Task.Factory.StartNew(ListenForClients, TaskCreationOptions.LongRunning); // Work With Clients Task.Factory.StartNew(WaitForClients, TaskCreationOptions.LongRunning); KeepAlive(); }
/// <summary> /// Instantiates the message queues /// </summary> void SetupQueues() { consumerQueue = MSMQHelper.CreateMessageQueue(GlobalVariablesLib.GlobalVariables.MYSQL_PLAYER_DB_CONSUMER_QUEUE_NAME); producerQueue = MSMQHelper.CreateMessageQueue(GlobalVariablesLib.GlobalVariables.MYSQL_PLAYER_DB_PRODUCER_QUEUE_NAME); }