Hi Mario,

re-reading the docs it does sound like the channel should be woken up if it has 
either OP_READ or OP_WRITE registered. The latter only is registered when you 
try to write something without success, but the former should always be 
registered unless you suspended reading (or did not resume it for pollMode). 
Are you certain that the socket is ready for reading when you make this test?

Regards,

Roland

27 aug 2014 kl. 21:12 skrev Mario Camou <mca...@tecnoguru.com>:

> Hi Roland,
> 
> It's not happening...
> 
> If you do it through localhost it works fine, but in the case where the 
> client is on a different machine from the Akka server, it doesn't happen. 
> I've tried with kill -9 and also pulling the power plug on the client box.
> 
> As I said before, when doing a netstat -an on the server side the socket 
> eventually disappears, but Akka doesn't find out about it until you actually 
> try to write data to the socket. I've been Googling around and diving into 
> the akka.io source code, and all I've found is people saying that the Java 
> ServerChannel doesn't tell you when the connection is closed until you try to 
> send something (which sounds like a really bad lack in Java if that is true).
> 
> For the moment I'm starting to do the same thing I did in the other project 
> back when this thread started: defining a new "Heartbeat" message type and 
> having a Scheduler periodically (I'm thinking every 30 seconds) send it, but 
> everybody else on my team to whome I've talked about this finds it really 
> strange.
> 
> Any ideas? Of course, I'm always open to it being a case of PEBKAC....
> 
> Cheers,
> -Mario.
> 
> 
> -Mario.
> 
> --
> I want to change the world but they won't give me the source code.
> 
> 
> On Wed, Aug 27, 2014 at 5:23 PM, Roland Kuhn <goo...@rkuhn.info> wrote:
> Hi Mario,
> 
> just to get this straight: you have a connection from process A to process B, 
> possibly on different machines. You kill -9 process A and process B is an 
> Akka application using IO actors. If that is right then there should 
> definitely be a ConnectionClosed event if at the time of the kill a TCP 
> connection was indeed established.
> 
> Regards,
> 
> Roland
> 
> 26 aug 2014 kl. 21:17 skrev Mario Camou <mca...@tecnoguru.com>:
> 
>> Hi again,
>> 
>> Sorry to reopen this thread after so long, but I'm in another project with a 
>> similar problem.
>> 
>> One thing I'm noticing is that, even after the OS closes the connection 
>> (i.e., it doesn't appear in netstat -an) my handler isn't getting any of the 
>> Tcp.ConnectionClosed messages. Is that normal? It looks bizarre to me.
>> 
>> What I'm doing is, starting a client that makes a connection, then doing a 
>> kill -9 to simulate the client crashing (or the client machine turning off). 
>> The socket stays there for a while (again checking via netstat -an) but 
>> eventually the OS closes it. Akka is not sending any message to indicate 
>> that the socket has been closed.
>> 
>> Any ideas short of doing what Roiland suggested earlier? (i.e., modifying 
>> the protocol to periodically send some data).
>> 
>> Thanks,
>> -Mario.
>> 
>> On Friday, December 27, 2013 9:26:46 PM UTC+1, Mario Camou wrote:
>> Hi, 
>> 
>> I’m using Akka I/O and am trying to set the SO_TIMEOUT socket value. 
>> 
>> Looking at the docs, I see that the Tcp.Bind message receives a 
>> Traversable[SocketOption]. However, looking at the docs for 
>> akka.io.Inet.SocketOption, the only subclasses are Broadcast, KeepAlive, 
>> OOBInline, ReceiveBufferSize, ReuseAddress, SendBufferSize, TcpNoDelay and 
>> TrafficClass. The superclass for the only SoTimeout class I see 
>> (akka.actor.IO.SoTimeout) is akka.actor.IO.SocketOption which I assume is 
>> part of the old (Iteratee-based) Akka I/O. 
>> 
>> So, how to set the SO_TIMEOUT using the new Akka I/O? Also, how to reset the 
>> SO_TIMEOUT once the socket has been opened? 
>> 
>> In my use case I need to set a relatively short SO_TIMEOUT value when the 
>> socket is first connected, and bump it up a bit after receiving the first 
>> actual message. 
>> 
>> Thanks, 
>> -Mario 
>> — 
>> I want to change the world, but they won’t give me the source code 
>> 
>> 
>> -- 
>> >>>>>>>>>> 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 http://groups.google.com/group/akka-user.
>> For more options, visit https://groups.google.com/d/optout.
> 
> 
> 
> Dr. Roland Kuhn
> Akka Tech Lead
> Typesafe – Reactive apps on the JVM.
> twitter: @rolandkuhn
> 
> 
> 
> -- 
> >>>>>>>>>> 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 http://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 http://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.



Dr. Roland Kuhn
Akka Tech Lead
Typesafe – Reactive apps on the JVM.
twitter: @rolandkuhn


-- 
>>>>>>>>>>      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 http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to