0

Hi all, I've just started learning server and client communication using socket.
What I'm doing here is like a Search Engine.
Server stores data (from a textfile) , then client search and check it exists or not.
Everything works fine, but I can't seem to loop for multiple search. (Meaning after client search and get results, it will continue prompting user to search for something else, until user ends the program by entering 'end')
My application ends after I finished searching once.
Is there a solution to this?

Thanks in advance.

3
Contributors
3
Replies
5
Views
6 Years
Discussion Span
Last Post by kings_mitra
0

>>Is there a solution to this?

Yes, use a loop. Your question is too vague to be of much more help.

Edited by Ancient Dragon: n/a

0

This is how I it to work:

Search for: abc
Found: abc

Search for: 123
Can't find 123

Search for: end
Good Bye!

I tried using a loop, but it just doesnt prompt me to search again, the client program just ended. Seems like my connection with the server/socket was closed. Is there a way to reopen connection/socket?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.