My client-server software should simulate an email service on a local machine.
Send, receive, delete functions works properly, now I have to implement the login service.
- Once the server is started, the function "InizializzaUtenti" create a list of users loaded from a text file "utenti.txt", then waits the client.
- The client, with the function "LogIn", sends a message to the server that contains username, password and a service code to request the login service (4)
- The server receive correctly the message and starts the function "LogIn" thet manage that service.
Problem
- Inside the server function "LogIn" the comparison between user and pass received from the client and those loaded from the text file do not work properly.
I think there should be a problem with line feed at the end of strings, but I can't solve the question. Is that the matter? Can you help me with the problem?
This is the essential code to menage the login service, I deleted everything else since it works and could confuse reading the code:
- http://lacasa.altervista.org/software/Server.c
- http://lacasa.altervista.org/software/Client.c
- http://lacasa.altervista.org/software/utenti.txt
txt file must be inside the folder where server process starts.
txt file structure is:
- line 1 -> username1
- line 2 -> password1
- line 3 -> username2
- line 4 -> password2
... and so on
To see the code you have to copy the url and paste inside the browsers address bar.
Problem found... as I thought it was a problem with CR and LF.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks