I have two programs , which are sitting on either side of a network socket . I have them make conversation with each other. One of them is a chat bot, which gives some responses, depending on what i enter as an input in the other program . Most of the time it does work flawlessly. But sometimes , the chat bot keeps waiting and waiting and i don’t get any reply back from it. This , however , happens very rarely. But does any one know, why it is happening ? How can i get rid of this obvious bug ?
I do check for most of the exceptions here, i/o exceptions being the most predominant one. But i don’t really get any exceptions. The program systems to hang around a thread , which i found out during debugging it .
Make sure you don’t swallow any exceptions. When something is wrong, the code will throw an exception telling you what is wrong (which hopefully gives you a clue how to fix it).