Hi Alexey,
You are right. I was missing that serverConnections were waiting for
listen().
Thanks!
Regards,
Bongjae Chang
On 3/10/14, 4:41 PM, "Oleksiy Stashok" <oleksiy.stashok_at_oracle.com> wrote:
>Hi Bongjae,
>
>unbindAll just closes ServerSocketChannels, so new connections won't be
>accepted, but at the same time existing connections will be still active.
>
>Hope that will help.
>
>WBR,
>Alexey.
>
>On 09.03.14 20:04, Bongjae Chang wrote:
>> Hi,
>> Grizzly provides GracefulShutdownListener interface so custom server
>> can implement graceful shutdown logic.
>>
>> When I reviewed NIOTransport#shutdown, there are 3 steps.
>> 1) state set to be STOPPING.
>> 2) unbindAll
>> 3) shutdown listener will be called and checked within period in
>> background thread and return a future.
>>
>> At this logic, I have a question above 2) and 3).
>> I think that all connections will be closed after 2) then server can't
>> send responses corresponding to requests which were received before
>> the shutdown operation.
>>
>> The following is an example.
>> ---
>> request 1: received
>> request 2: received
>> (start to shut down)
>> request 3: rejected with STOPPING state
>> request 4: rejected with STOPPING state
>> ..
>> processing request 1, 2: graceful
>> ..
>> unbindAll
>> sending response 1, 2: maybe server canšt send responses because there
>> are no connections.
>> ---
>>
>> I think that request 1 and request 2šs responses should be sent to
>> clients but canšt because connections are already closed.
>>
>> I donšt know whether I have a right understanding. Please correct me
>> if I am missing some points.
>>
>> Thanks!
>>
>> Regards,
>> Bongjae Chang
>>
>