Need to ensure that a message is sent and a response is received before the socket is closed

John Platts john_platts at hotmail.com
Wed Sep 16 11:14:47 EDT 2009


I am writing a VoIP TAPI integration program that uses Netty.

I need to ensure that the following occurs before the socket channel is disconnected or closed:
1. If a close is requested, and the socket channel is disconnected, the channel is simply closed.
2. If the socket channel is already closed or disconnected, the steps below are skipped.
3. An unregistration request message is written out to the socket channel.
4. We want to do the actual close or disconnect, but only after one of the following conditions is true:
   - The writing of the message sent in step #3 is done, but is unsuccessful
   - The unregistration acknowledgment message is received and processed
   - The unregistration acknowledgment message is not received within a certain time interval
   - The socket gets disconnected because of an timeout
   - The socket gets disconnected as a result of the other endpoint disconnecting the socket

How do I accomplish the above in Netty? I am using Netty 3.1.3.

_________________________________________________________________
Hotmail: Powerful Free email with security by Microsoft.
http://clk.atdmt.com/GBL/go/171222986/direct/01/


More information about the netty-users mailing list