public void ClientHandler()//this function will be passed to the thread and handle the client request.
        {
            NetworkStream Stream;

            //FormOperator.sms("Test");
            Stream = Client.GetStream();
            //FormOperator.sms("Test2");
            StreamReader reader   = new StreamReader(Stream);
            StreamWriter writer   = new StreamWriter(Stream);
            string       recieved = reader.ReadLine();

            FormOperator.sms(recieved);///////////////////////////
            string[] splitted = new string[2];
            splitted = recieved.Split(';');
            string Operation = splitted[0];
            string netString = splitted[1];

            call = new BlockingLayer();
            string[] result = call.FunctionCaller(Operation, netString);
            //FormOperator.sms(result[0]);//////////////////////////////
            writer.WriteLine(result[0]); //sending the result to the client as a string, because streamReader and writer
                                         //only sends and recieves Strings.
            writer.Flush();
            Stream.Close();
            Client.Close();
            Thread.CurrentThread.Abort();
        }
Esempio n. 2
0
        public static string[] ModifyTeller(string netString)
        {
            string        operation = "ModifyTeller";
            BlockingLayer b         = new BlockingLayer();

            string[] result = new string[1];
            result = b.FunctionCaller(operation, netString);
            return(result);
        }
Esempio n. 3
0
        public static string[] AddTeller(string netString)
        {
            string        operation = "AddTeller";
            BlockingLayer b         = new BlockingLayer();

            string[] result = new string[1];//this array take the returning value of the function FunctionCaller which is a Function of BlockingLayer class.
            result = b.FunctionCaller(operation, netString);
            return(result);
        }
Esempio n. 4
0
        public static string[] ViewTellers()//this method doesn't need any parameters.
        {
            string        operation = "ViewTellers";
            string        netString = "ViewTellers";
            BlockingLayer b         = new BlockingLayer();

            string[] result = new string[1];
            result = b.FunctionCaller(operation, netString);
            return(result);
        }