public WorkInThread(Socket socket, int opCount, WorkItem item, string operation, Work work) { this.socket = socket; this.opCount = opCount; this.item = item; this.operation = operation; this.work = work; }
public static void Main(string[] args) { Random rand = new Random(); System.Console.SetWindowSize(80,50); Work work = new Work(rand); ServerHelper helper = new ServerHelper(work); helper.StartListener(); int opCount = 0; string operation = ""; do { operation = helper.WaitingForClient(opCount); opCount = Program.incrementOpCount(opCount); } while (!CommunicationHelper.OP_KILL.Equals(operation)); System.Console.WriteLine("Kill Server by client.."); helper.StopListener(); }
public ServerHelper(Work work) { this.ipAddress = IPAddress.Parse(CommunicationHelper.HOST); this.listener = new TcpListener(this.ipAddress, CommunicationHelper.PORT); this.work = work; }