Question

I would appreciate if someone could help.

I have written a Client/Server Sockets application. The client is Windows Forms C# app and the server is a C# console app which runs locally. The client application has a login form containing the field with generated port.

When user logins he is connecting to the server using that port and the server continues listening incoming connections.

Everything works fine when I test my application simply running several instances of Visual Studio project on one PC. Now, I would like to test it on several PCs and I am very confused here. I would be grateful if someone could explain in simle words how to run my app on two machines.

How do both users connect to the same server? Where should it be located? Should the server have one IP and different ports per one users group?

Also, my application uses SQL Server Database which is installed locally on one PC. So the application uses connection string with that PC Name. In case of two PCs is it possible to connect the second computer to DB on first PC?

I am sorry if this sounds silly :)

Thanks a lot

Was it helpful?

Solution

So if I am correct you are wondering the following three things?

Q1. How do I test my software in a multiple machine environment.

A: This is perhaps not really a Stackoverflow question but what I would do in this case is to have a small setup in Hyper-V with several machines with different operating systems that all have a shared folder that I can deploy my code to. Of course for more extended testing you would need to get more machines and copy the executables to that machine for testing for the first stage and perhaps write a setup software for the second stage of testing, but that depends on the how much testing you actually do.

Q2. How to I allow several users to connect to my service?

A: I think that Anthony Horne has a great answer to this in the comments - Tell your service to listen on port X and when a client tries to connect open a new communication instance on port Y and ask the client to call back to that port. This is as far as I know industry standard for solving this type of problem.

Q3. My application uses a SQL Server Database can I allow clients to connect to it remotely.

A: Yes you can. Please see this Stackoverflow question.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top