Difference between Reactor pattern and TCPServer

Please post support and help requests here.
Sylva1n
Posts: 4
Joined: 12 Dec 2012, 23:56

Difference between Reactor pattern and TCPServer

Postby Sylva1n » 13 Dec 2012, 23:10

Hello,

my app has to listen to multiple clients using a TCP socket.

Can I use the Reactor pattern rather than TCPServer?

I don't understand if the Reactor pattern supports several clients...


Thank you,

Sylvain

alex
Posts: 1297
Joined: 11 Jul 2006, 16:27
Location: United_States

Re: Difference between Reactor pattern and TCPServer

Postby alex » 13 Dec 2012, 23:47

Sylva1n wrote:Can I use the Reactor pattern rather than TCPServer?
I don't understand if the Reactor pattern supports several clients...

It does but it will serve them serially. You can have multiple reactors, each in its own thread just make sure you coordinate well how notifications are handled.
EDIT: to be more precise, socket handles are looped over through select (poll/epoll if available). Notifications are dispatched through NotificationCenter.


Return to “Support”

Who is online

Users browsing this forum: er6 and 2 guests

cron