quit|aaa[eoq]
quit|bbb[eoq]

quote|aaa[eoq]
quote|bbb[eoq]

feed|aaa[eoq]


feed|aaa[eoq]
feed|bbb[eoq] 
feed|ccc[eoq]
feed|ddd[eoq]


Version 2

added the producer/consumer queue to fastest the reading 
of the bytebuffer channel.

change one thread by connection by Selector




Version 3

pu besoin de la classe : ConnectionAcceptor




This project consists of a small demo of a real-time quote stock server.
For more information on migration, a guide was written: "How to convert NIO server to Grizzly.

This application allows the client to ask for a quote or a quote feed and the current updates on the stock are returned as a result. To do, this server simulates a 3rd party connection (where it will get the quotes for the symbols).
If this server looses the connection with the 3rd party, it will attempt a reconnect. Once established, it will resend all the quote feed request to the 3rd party.

In a real application the server should be able to handle the following:

50 clients simultaneously and 5000 symbols cached.  
Of theses clients, there will be 5 administrators.
The administrators will receive all the symbols updates in real time. 
There will be around 20 clients that will ask for 100 symbols quote feed.
The remaining clients will ask for a quote and disconnect afterwards.  
We can expect have a request each second from clients.

Remarks:

The server will listen on a TCP port for incoming client.  A thread will be created for each client.
The server has a limited buffer size for parsing the client request.  If the buffer limit is reached, the server will close the connection with the client.
When a client requests a quote, the server will return the latest quote from cache if there was a quote feed requested. 
When the client disconnect from the server, the server will stop the quote feed if there is no more client can subscribe to the feed. 
When a client disconnect the server throws a java.nio.channels.AsynchronousCloseException.
When the server loses the connection with the 3rd party, it will resend all the quote feed. If the 3rd party can't handle all the requests at the same time, it can close the connection, and we will be in a loop. In this case, the server will keep resending all the requests, and the 3rd party will close the connection.  Need to be able to add delay between the sending.

