Ask a question to Desklib · AI bot


Stage One: You will be expected to submit a CD on Friday 25th

3 Pages499 Words136 Views

Added on  2019-09-16

BookmarkShareRelated Documents
Stage One: You will be expected to submit a CD on Friday 25th November 2016 at the lecture. There should be three projects present on the CD – Client (two to run in demo), Middleware and Server (details below).AssignmentTo develop a three tier system that will simulate a guessing game.Stage One: (to get a basic pass) will expect the passing of a message from the clients to the middleware, to the server, back to the middleware and then back to the correct client. This is the basic framework for the coursework.Stage One 40-50% -> by the due date to have accomplished message passing from both clients – middleware – server – middleware – appropriate client.The Server:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Net;using System.Net.Sockets;namespace ConsoleApplication2{classProgram {staticvoid Main(string[] args) {Socket sck = newSocket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); sck.Bind(newIPEndPoint(0, 1994)); sck.Listen(0);Socket acc = sck.Accept();Console.WriteLine("Connection has been made to the server from theClient");byte[] buffer = Encoding.Default.GetBytes("Hello sent from Server to Client"); acc.Send(buffer, 0, buffer.Length, SocketFlags.None);byte[] recbuffer = newbyte[255];int rec = acc.Receive(recbuffer, 0, recbuffer.Length, 0);Array.Resize(ref recbuffer, rec);Console.WriteLine("received from client the string: {0}", Encoding.Default.GetString(recbuffer));
Stage One: You will be expected to submit a CD on Friday 25th_1

Found this document preview useful?

Related Documents
Comparison of Iteration and Recursion in C#

Assignment 4 Solutions