The Akka IO API is actor based and a bit more low level, requiring more boilerplate, the streams one is a higher level API which fits some problems (and mindsets) very well. Performance will likely not differ much so try both and use the one you find easiest to understand and achieve what you want with.
-- Johan Akka Team On Wed, Sep 13, 2017 at 4:01 PM, <techland.co...@gmail.com> wrote: > Someone who can help me ??? > > On Saturday, September 2, 2017 at 3:53:20 PM UTC+4:30, > techlan...@gmail.com wrote: > >> hi every one >> I'm using akka 2.5.x how can call Socket async for read and write ?(what >> is the best solution) >> i need many connection concurrency for send email this is sample code >> java ? >> >> public boolean sendEmail(String data, String from, String to,String subject) >> throws IOException { >> Socket socket; >> InputStream inn; >> OutputStream outt; >> BufferedReader msg; >> socket = new Socket(mailHost, SMTP_PORT); >> if (socket == null) { >> return false; >> } >> inn = socket.getInputStream(); >> outt = socket.getOutputStream(); >> in = new BufferedReader(new InputStreamReader(inn)); >> out = new PrintWriter(new OutputStreamWriter(outt), true); >> if (inn == null || outt == null) { >> log("Failed to open streams to socket."); >> return false; >> } >> String initialID = in.readLine(); >> out.println("HELO " + localhost.getHostName()); >> String welcome = in.readLine(); >> out.println("MAIL From:<" + from + ">"); >> String senderOK = in.readLine(); >> out.println("RCPT TO:<" + to + ">"); >> String recipientOK = in.readLine(); >> out.println("DATA"); >> out.println("From:Ehsan test<"+from+">"); >> out.println("To:Ehsan uni<"+to+">"); >> out.println("Cc:khodam <"+to+">"); >> out.println("Subject:"+subject); >> Date d=new Date(); >> out.println("Date:"+d.toString()); >> // this body of email >> out.println(data); >> out.println("."); >> // end of email >> String acceptedOK = in.readLine(); >> out.println("QUIT"); >> return true; >> } >> } >> how can implement with akka ? >> how can write and read async ? >> could help me for this solution >> >> >> -- > >>>>>>>>>> Read the docs: http://akka.io/docs/ > >>>>>>>>>> Check the FAQ: http://doc.akka.io/docs/akka/ > current/additional/faq.html > >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user > --- > You received this message because you are subscribed to the Google Groups > "Akka User List" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to akka-user+unsubscr...@googlegroups.com. > To post to this group, send email to akka-user@googlegroups.com. > Visit this group at https://groups.google.com/group/akka-user. > For more options, visit https://groups.google.com/d/optout. > -- >>>>>>>>>> Read the docs: http://akka.io/docs/ >>>>>>>>>> Check the FAQ: >>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user --- You received this message because you are subscribed to the Google Groups "Akka User List" group. To unsubscribe from this group and stop receiving emails from it, send an email to akka-user+unsubscr...@googlegroups.com. To post to this group, send email to akka-user@googlegroups.com. Visit this group at https://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.