Whow much data is possible using a winsock control
High, I'm trying to change my application from single user to multi-user.
To start off I'm wondering if I need to minimize the data send between the stations or not.
The maximum amount would be something like two to 3 hundered single variables that would be sent each simulation step (each second). There would be a maximum of 4 users, and it would all be in a lokal network.
Would such an amount of data fit within a second? Or do I need to minimize the data that is send?
Re: Whow much data is possible using a winsock control
The volume of data shouldn't be a problem but how you send it could. Two to three hundred variables in a single record would be no problem at all. Two to three records of a single variable (sent individually) may be a problem.
Re: Whow much data is possible using a winsock control
Thanks ccoder, so I'll give the "easy" way a try.
Thanks for the reply
Re: Whow much data is possible using a winsock control
If you can provide a better picture of what you will be sending back and forth, I could provide some ideas as to how to organize and send the data. I typically send large, complex UTDs to other apps.
Re: Whow much data is possible using a winsock control
Just as stated, I'd be sending about 2 to 3 hundred single variables from the main instance that controls the simulation, all of them should be sent in one message. The other instances would recieve that and send some data back (but not as much the main instance).
It all belongs to a simulation, where one station controls all the simulated units/persons, while the other stations act to that.
Re: Whow much data is possible using a winsock control
You may gain some size efficiency by putting them in a UDT or Class (in case this is .NET).
What protocol? UDP?
Re: Whow much data is possible using a winsock control
Sorry, still VB6
I haven't decided which protokoll, I'm not that far.
Which would fit, does it make a difference that all instances have to send and recieve. The major one would send each simulation step (second), the others might only send when a change has occured.
?? UDT = User defined Type ??
Re: Whow much data is possible using a winsock control
Yes, about UDT, and since you are talking about VB6, then forget the bit about classes.
Hmmm, 300 single variables....that would be 300*8 = 2,400 bytes. Right? Plus overhead on the packets. At the moment, I can't remember if that will be smaller than most packets or not. If it is, then you should look into UDP as the protocol. TCP makes more sense when one system is the client initiating a transaction, while a central server is awaiting connections. In your case, it sounds like any system can initiate communication, in which case a UDP based peer-to-peer system seems more reasonable.
UDP is fast, conectionless, and unreliable. It is that last one that could cause you trouble. Unreliable means that the packets are sent out, but they are not guaranteed to be received, and the order is not guaranteed either. If your data is large enough to span multiple packets, you would have to add more info to each UDPgram to allow the receiver to know when it has all the data, and allow it to stitch packets back together when they are received.
Furthermore, since a packet could be lost, you need to adopt some strategy to deal with that. In most games, dropping a packet makes no difference, because character postion changes are rapid enough that if one position change is missed, it is no big deal to the flow of the graphics (while some packets might be dropped, dropping packets isn't exactly common). This would be a loss tolerant system. No individual packet is critical. For critical packets, you could implement a return receipt system such that the sender keeps sending until the return receipt is received, or until you can be pretty sure that NO messages are getting through.
As for speed, in my experience, moving that much data over a LAN using UDP will take far less than a second.
Re: Whow much data is possible using a winsock control
Thanks Shaggy,
That will give me a start.
I'll be coming back with questions for sure, whne I'm actually start to use the Winsock Control. Presently it's al concept fpor that part.
As for UDT's, I'm using them already.