Sockets read byte by byte

0

I'm doing an exercise which is a client and server. (TDP)

Client asks 2 questions The server reads them and replies them with results already saved ("for example with a list of random names")

It's part of it. But the exercise tells me the following:

"Once the client sends a question to the server, it will read the message byte by byte until it finds the ascii character"? ".

my program what it does is look for the complete sentence:

 if(request!= null && request.equalsIgnoreCase("Como te llamas?")){
 Collections.shuffle(Nom);
            result =Nom.get(0);
            return result;

And inside the if I assigned the result.

The part of the program with the random names is:

  String[] PreguntaNom = {
            "El meu nom es Montse",
            "El meu nom es Montserrat"
            };

I lose myself completely with the way I want my teacher to do it. Can you give me an example?

    
asked by Montse Mkd 05.04.2018 в 20:21
source

0 answers