dlsantos / dnp3

Automatically exported from code.google.com/p/dnp3
0 stars 0 forks source link

Accept multiple connections on a single TCPServer that is bound to a Master or Slave stack #32

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
The TCPServer class is used to accept new connections from a TCP client.  This 
is used for both Master/Slave stacks as well as VTO routers.  When used as a 
Master/Slave stack, it would be beneficial to have a single TCPServer instance 
continue to accept new connections.  This supports the case of multiple Masters 
trying to access one Slave instance, for example.

Slave: TCPServer port 20000
Master #1: TCPClient port 1234 -> Slave
Master #2: TCPClient port 1234 -> Slave

Currently, the Slave would need to instantiate multiple TCPServer instances.  
However, to support this, the full number of Masters needs to be established 
ahead of time.  In addition, the Master<-->port mapping on the slave side needs 
to be established up-front.  However, the new "address discovery" 
(UNKNOWN_ROUTE) log entry mechanism allows us to now have a single Slave 
register a TCPServer listener which then could continually accept new TCPClient 
connections from masters that don't need to be defined ahead of time.

Original issue reported on code.google.com by chris.ve...@gmail.com on 16 Oct 2011 at 7:29