Ask a question from expert

Ask now

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

3 Pages499 Words136 Views
   

Added on  2019-09-16

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

   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

End of preview

Want to access all the pages? Upload your documents or become a member.

Related Documents
Comparison of Iteration and Recursion in C#
|5
|903
|113

Assignment 4 Solutions
|6
|1440
|1