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

Added on - 16 Sep 2019

Trusted by 2+ million users,
1000+ happy students everyday
Showing pages 1 to 1 of 3 pages
Stage One: You will be expected to submit a CD on Friday 25th November 2016 at thelecture. 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 themiddleware, to the server, back to the middleware and then back to the correct client. Thisis the basic framework for the coursework.Stage One 40-50% -> by the due date to have accomplished message passing from bothclients – middleware – server – middleware – appropriate client.The Server:usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;usingSystem.Net;usingSystem.Net.Sockets;namespaceConsoleApplication2{classProgram{staticvoidMain(string[] args){Socketsck =newSocket(AddressFamily.InterNetwork,SocketType.Stream,ProtocolType.Tcp);sck.Bind(newIPEndPoint(0, 1994));sck.Listen(0);Socketacc = sck.Accept();Console.WriteLine("Connection has been made to the server from theClient");byte[] buffer =Encoding.Default.GetBytes("Hello sent from Serverto Client");acc.Send(buffer, 0, buffer.Length,SocketFlags.None);byte[] recbuffer =newbyte[255];intrec = acc.Receive(recbuffer, 0, recbuffer.Length, 0);Array.Resize(refrecbuffer, rec);Console.WriteLine("received from client the string: {0}",Encoding.Default.GetString(recbuffer));
Desklib Logo
You are reading a preview
Upload your documents to download or

Become a Desklib member to get access