Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #26433
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news-1.dfn.de!news.dfn.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail |
|---|---|
| From | Robert Klemme <shortcutter@googlemail.com> |
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: java mail and thread |
| Date | Sat, 26 Oct 2013 13:07:44 +0200 |
| Lines | 27 |
| Message-ID | <bd1m45Fme69U1@mid.individual.net> (permalink) |
| References | <6615a997-f18f-42b0-812e-de1cbadf8341@googlegroups.com> <1tainohfwpuj1.1v1jokfkdmezh.dlg@40tude.net> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=ISO-8859-1; format=flowed |
| Content-Transfer-Encoding | 7bit |
| X-Trace | individual.net EBkL6SHtCG5bisRIoA9cEw2rD6cr0Me/TylTBNg2x+xCWSjJU= |
| Cancel-Lock | sha1:ph923XAuRpKGO2RCj6hQlR2pgzs= |
| User-Agent | Mozilla/5.0 (Windows NT 6.0; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.0.1 |
| In-Reply-To | <1tainohfwpuj1.1v1jokfkdmezh.dlg@40tude.net> |
| X-Antivirus | avast! (VPS 131026-1, 26.10.2013), Outbound message |
| X-Antivirus-Status | Clean |
| Xref | csiph.com comp.lang.java.programmer:26433 |
Show key headers only | View raw
On 25.10.2013 13:45, Joerg Meier wrote: > On Thu, 24 Oct 2013 14:28:49 -0700 (PDT), andros976@gmail.com wrote: > >> I noticed that this statement takes a bit of seconds before releasing >> flow and therefore are unable to use the other functions of the application . I thought , therefore, to use a technology where each object of the class that sends the email implements Runnable and then i use it like a thread. >> I noticed , however, that there are problems because sometimes 20 over 50 emails fail and the instruction that give me the error is > >> Transport.send (msg ) ; > >> java.net.SocketException : Connection closed by remote host > > Possibly the remote server doesn't allow multiple (or more than 2 or 3) > connections at the same time. I recommend writing a thread class that keeps > an internal list of mails to send, and sends them one by one. That way, > when you send two mails at the same time, the 2nd gets added to the list > and sent after the first finishes, instead of at the same time. Or create a thread pool with as many threads as concurrent connections are allowed. Then feed send requests through a queue. Cheers robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
java mail and thread andros976@gmail.com - 2013-10-24 14:28 -0700
Re: java mail and thread Knute Johnson <nospam@rabbitbrush.frazmtn.com> - 2013-10-24 15:07 -0700
Re: java mail and thread lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-10-25 12:30 +0100
Re: java mail and thread Joerg Meier <joergmmeier@arcor.de> - 2013-10-25 13:45 +0200
Re: java mail and thread Robert Klemme <shortcutter@googlemail.com> - 2013-10-26 13:07 +0200
Re: java mail and thread andros976@gmail.com - 2013-10-27 01:46 -0700
csiph-web