Server client application what is the best choice??

francot514

Well-Known Member
I started this post, because i want to convert my sims ville roleplay into a server client application, and need some help about making choices for best implementation. I know there can be two choices what i barely know: tcp/ip listener and winsocks. Remeber im using Visual .net to development.
What im trying to do is that be able to my program send data or packages between client and server or client-client, to allow the neighborhood be synchronized and all the changes made locally will send trough and loaded into other players...
Any help or suggestion will apretiated.
 
If you're using C# or VB.net, they don't come with a native Winsock implementation, though it should be possible to load the Winsock libs using P/Invoke. However, it is not recommended. It's... kinda like making a fire in your kitchen when there's a stove available (OK, bad analogy, but whatever).
Here's example code for asynchronous sockets in C#/VB.net, and here's an example with multithreaded TCPListener code in VB.net.
Though to be honest, if I wanted to make sure I could support hundreds or even thousands of clients in a client/server model, I would just use async sockets. Trying to make TCPListener work in a multithreaded environment is reinventing the wheel, and likely not to be as good.
If you're just aiming for a peer to peer approach, TCPListener is fine.
 
@ xexzno, what updater do you mean????

@Afro thanks for recomendations, i think will be better using sockets, becaise as you say if i use tcplistener i had to reinvent the code and that will kind more work to me...
 
The updater I am working on for OpenTSO... I kinda abandoned it though. I'm probably going to restart it, idk.
 
TCP makes reliably communicating streams of bytes over the internet as reliable and easy as doing it to your hard drive.

What are you having trouble with? Are you having trouble finding example code?
 
Back
Top