All pastes #30175 Raw Edit

ddd

public text v1 · immutable
#30175 ·published 2005-11-22 01:32 UTC
rendered paste body
using System;
using System.Net;
using System.Net.Sockets;

namespace TC
{
	/// <summary>
	/// Summary description for Class1.
	/// </summary>
	
	public class ClientData
	{
		public Socket GetSocket() { return socket; }
		public void SetSocket( Socket skt ) { socket = skt; }
		private Socket socket;
	}

	class Class1
	{
		const int MAX_CLIENTS = 1024;
		static public ClientData [] Clients = new ClientData[MAX_CLIENTS];
		/// <summary>
		/// The main entry point for the application.
		/// </summary>
		[STAThread]
		static void Main(string[] args)
		{
			
			Console.Write("Searching...");
			for ( int i = 0 ; i < MAX_CLIENTS ; i++ )
			{
				Console.Write("Searching...");
				if ( Clients[i].GetSocket() == null )
				{
					Console.Write("Found Free Slot:" + i.ToString() + " !");
				}
			}
			Console.Write("Done!");
			
		}
	}
}