Sockets (Urgent)

  • Thread starter Thread starter Yuri Ch
  • Start date Start date
Y

Yuri Ch

Hi all,
I'm quite new in C# and have no expirience in sockets.
I have no idea how to implement the following app, but for expirienced
developer, I suppose it should be very trivial...

I have to write any server component very urgent...
The component has to synchronize between 3 clients for perpetual work of
one of them.

My app works with several clients, says C1, C2, C3.
I know IP and Port of each client. Every time should be only one working
client. On the start my program has to send to C1 any parameters. If it
succeeded the program sleeps all the time C1 works. If C1 failed down
(the program or whole computer) my app has to catch it and try to
connect to C2.
If working any client except C1 my app has to try if possible to connect
to C1 and if yes, disconnect from C2 or C3 and connect to C1.

Any samples of code will be very helpful.

Thanks a lot,
 
Hi,

Why don't you use Remoting instead of raw sockets? You can publish the three
clients (c1, c2, c3) with minimum work. Also, you can use load balance on
remoting so you make sure that only one customer executes at one time.

On remoting you can use synchronic and asynch calls where you can register a
delegate that will let you know if the call failed or not, so you can decide
to retry on other registered remoting address.

Hope this helps
Salva
 
Back
Top