voodoodyne / subethasmtp

SubEtha SMTP is a Java library for receiving SMTP mail
Other
343 stars 138 forks source link

Restart Server #63

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
If you, whyever, want to restart the SMTPServer by using the stop() and 
afterwards the start()-method, you will get an IllegalStateException. The 
start()-Method just checks whether the "started"-boolean is set to true and 
then it will throw it. The stop()-Method closes all connections and stops 
everything, but it doesn't set the boolean to false again. 

Simply reset the attribute in the stop() has worked for me.

Original issue reported on code.google.com by p.t...@xceptance.net on 18 Apr 2013 at 4:58

Attachments:

GoogleCodeExporter commented 9 years ago
Found same problem. Fix is very simple, will be build-in? Thx Jakub.

Original comment by jakub.ma...@akineta.cz on 22 Aug 2013 at 12:22

GoogleCodeExporter commented 9 years ago
I'm experiencing the same issue.  

are there plans to fix this anytime soon?

as a workaround, should I create a new object of SMTPServer instead of trying 
to start one that was started and stopped before?

Original comment by twentyon...@gmail.com on 4 Oct 2013 at 4:48

GoogleCodeExporter commented 9 years ago
SMTPServer must not be restarted, because the ExcecutorService instance, which 
it uses, and which it may receive from outside of the library, is not 
restartable itself. See Issue 48. Instead of stopping and starting an existing 
instance, create a new one.

I close this issue with WontFix, but I updated the javadoc and the exception 
message to be more explicit. 

Original comment by hontvari@flyordie.com on 14 Oct 2013 at 1:15