• Post Reply Bookmark Topic Watch Topic
  • New Topic

InterruptedException  RSS feed

 
Ajitha Rao
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am working on a CIMD connect aplication.Out there if there is a error thrown by the SMSC the thread has to be interrupted and a new thread is started.The problem is that whenever the conn.stop() is called it throws a InterruptedException is thrown,which is not solving the purpose.Is there a way where I can avoid this exception and get things working fine.here is the code for start and stop methods.Help needed fast.
public void start() throws Exception
{
launcher.LOGGER.debug("CIMDCOnnection starting");
m_running = true;
smsc = new Socket(m_SMSCIP, m_SMSCPort);
bw = new BufferedWriter(new OutputStreamWriter(smsc.getOutputStream()));
is = smsc.getInputStream();
br = new BufferedReader(new InputStreamReader(is));
smscThread.start();
login();
kat.start();
launcher.LOGGER.debug("CIMDCOnnection started");
}
public void stop() throws Exception
{
launcher.LOGGER.debug("CIMDCOnnection stopping");
kat.stop();
m_running = false;
smscThread.interrupt();
smsc.shutdownOutput();
smsc.shutdownInput();
smsc.close();
launcher.LOGGER.debug("CIMDCOnnection stopped");
}
Thanks in advance.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!