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

Added on - 16 Sep 2019

  • 3

    Pages

  • 499

    Words

  • 48

    Views

  • 0

    Downloads

Trusted by +2 million users,
assist thousands of 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’re reading a preview
Preview Documents

To View Complete Document

Become a Desklib Library Member.
Subscribe to our plans

Download This Document