Re: [twsocket] [ICS] mmorpg capacity question

2005-11-01 Thread Francois Piette
> >> You need to have a Windows _server_ version to support > >> 1000 simultaneous connections. > > I wonder what the limitations on workstation versions are? > > A few hundreds? > There is no limitation. The difference is that > the server versions will > hadle more efficient this kind of huge I

Re: [twsocket] transmission stress test

2005-11-01 Thread Wilfried Mestdagh
Hello David, > for the "ptrTemp". (1) What is the best number , i.e. a number > that gaurentee it is not to o small, while not occupying too much > memory? 8 KB is a good size if you have a fast network. > have ptrTemp as a fixed size buffer determined at design time, and have > it locally i

Re: [twsocket] Receive size..?

2005-11-01 Thread Wilfried Mestdagh
Hello David, you receive first 50, and then OnDataAvailble will be fired again immedialty where you receive next 50. So there is no problem. --- Rgds, Wilfried [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html http://www.mestdagh.biz Wednesday, November 2, 2005, 02:20, Kei wrote: > if

Re: [twsocket] [ICS] mmorpg capacity question

2005-11-01 Thread Wilfried Mestdagh
Hello Jack, There is no limitation. The difference is that the server versions will hadle more efficient this kind of huge IO. The only limitation is the amount of non-paged memory pool (the part that not be swapped to disk). On Intel86 systems this pool can grow to maximum 1/8 of phisical RAM. A

Re: [twsocket] [ICS] mmorpg capacity question

2005-11-01 Thread Jack
I wonder what the limitations on workstation versions are? A few hundreds? > You need to have a Windows _server_ version to support > 1000 simultaneous connections. -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket V

[twsocket] Receive size..?

2005-11-01 Thread Kei
if I specify a buffer that is actually not big enough to hold a packet, then what will happen? e.g. var myBuffer: array[0..50] of char; receivedSize: longint; receivedSize := MywSock.receive(myBuffer); if the socket wants to give me 100 bytes but I only have 50.. what will happen? Da

Re: [twsocket] transmission stress test

2005-11-01 Thread Kei
I got it. so this is what I'll do: A> txt 10240 B> (malloc ptrAltogether 10240 bytes; Let sizeRemain = 10240;sizeDone=0) sendtxt A> "010010101010101..." B> (First packet is ready: var ptrTemp: array[0..MAX_PACK] of char; Zero(ptrTemp); if(sizeThisPack = Receive(ptrTemp) > 0)

Re: [twsocket] Send one big or a lot of small strings

2005-11-01 Thread Wilfried Mestdagh
Hello Arnaldo, Yes that is another option, but the 1 second delay he had has nothing to do with it. TCP_NODELAY disable the Nagle algoritm. If my RAM serve me well Nagle will wait at maximum 100 milliseconds for transmit to see if something else is coming. And it will do this delay only if there

Re: [twsocket] transmission stress test

2005-11-01 Thread Wilfried Mestdagh
Hello David, > So I ignored the zero und -1 returned by the Receive(), and it worked :) Great ! I'm glad it works for you :) > But the "TempSize" in my code was never changed. it was set as to a > constant value en the constructor. Ok no problem then. But if your buffer has a constant size, t

Re: [twsocket] Send one big or a lot of small strings

2005-11-01 Thread Arnaldo Braun
You can force socket faster small packet sending by using TWsocket ---> ComponentOptions > wsoTcpNoDelay ---> true See Microsoft socket help files about possible collateral effects (search setsockopt TCP_NODELAY) Larini wrote: >Why this event must be used? >I'm testing my application

Re: [twsocket] transmission stress test

2005-11-01 Thread Kei
Thanks for taking the time to read my dirty code.. I apologize if that is too hard to read for you ... I'm not a good programmer yet... sorry! So I ignored the zero und -1 returned by the Receive(), and it worked :) But the "TempSize" in my code was never changed. it was set as to a constant va

Re: [twsocket] Send one big or a lot of small strings

2005-11-01 Thread Francois PIETTE
I would add that PutStringInSendBuffer and PutDataInSendBuffer are very useful when you have small data chunks that you want to send in a bigger one. That is make as possible as sure that the packets have maximum size. for a:=0 to 80 do Socket.PutStringInSendBuffer(MyString); Socket.Send(nil,

Re: [twsocket] Send one big or a lot of small strings

2005-11-01 Thread Arno Garrels
Larini wrote: > Why this event must be used? It's not a must, I'm talking about larger amount of data. It saves memory because the internal send buffer grows dynamically. For instance if your string is 1 GB also 1 GB of RAM would be allocated internally. It also keeps your application responsive,

Re: [twsocket] Send one big or a lot of small strings

2005-11-01 Thread Wilfried Mestdagh
Hello Larini, Time for transfer a packet from one machine to another is depending on the load of the network. OnDataSent is prefer to use if you send big amounts of data. You can however push whole data into TWSocket and it will send it in chuncks for itself, but if you for example send 100 MB da

Re: [twsocket] Send one big or a lot of small strings

2005-11-01 Thread Larini
Why this event must be used? I'm testing my application and some times a send of a small packet take 1 second, other times the same packet take about no time. There is a way to force send anyway? This mail was sent by Webmail 2.5 -- To unsubscribe

Re: [twsocket] Send one big or a lot of small strings

2005-11-01 Thread Arno Garrels
Larini wrote: > Hi, I want to know if there are a difference between the two codes bellow: > > MyString = 100 bytes > > 1. > For a:=0 to 80 do > socket.SendStr(MyString); > > > 2. > For a:=0 to 80 do > aux:=aux+MyStr; > socket.SendStr(aux); > > > The first one, sends about 8000 bytes using 8

Re: [twsocket] Send one big or a lot of small strings

2005-11-01 Thread Wilfried Mestdagh
Hello Larini, for winsock it will end up probably the same, but in (2) you are 80 times re-allocating memory and probably copying bytes several times. if you really dont can create the send buffer at once you can do this: for a := 0 to 80 do Socket.PutStringInSendBuffer(MyString); Socket.Sen

[twsocket] Send one big or a lot of small strings

2005-11-01 Thread Larini
Hi, I want to know if there are a difference between the two codes bellow: MyString = 100 bytes 1. For a:=0 to 80 do socket.SendStr(MyString); 2. For a:=0 to 80 do aux:=aux+MyStr; socket.SendStr(aux); The first one, sends about 8000 bytes using 80 sendstr commands The second send about 8000

Re: [twsocket] SocketSpy Re-Reply

2005-11-01 Thread Wilfried Mestdagh
Hello, Sorry, you need a typecast: Client := TClient(WSocketServer.Client[n]); --- Rgds, Wilfried [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html http://www.mestdagh.biz Tuesday, November 1, 2005, 11:09, ICSNewbie2005 wrote: > Hi Mr. Wilfried M., > Yes below is code I am talking ab

Re: [twsocket] transmission stress test

2005-11-01 Thread Wilfried Mestdagh
Hello David, > GetMem(TempBuffer, TempSize); // first packet > bytesReceived := Self.Receive(TempBuffer, ReceiveSize); In the part where you allocate mem for first packet ReceiveSize should be set to TempSize. Wy do you allocate anyway. Wy not put your buffer as an array on the stack

Re: [twsocket] transmission stress test

2005-11-01 Thread Francois PIETTE
I'm sorry to tell youi your OnDataAvailable event handler is wayy too complex and difficult to read. First, you should use better naming conventions. See the naming used in all ICS demos. For example, I would have named as follow: TSession => TSessionWSocket or TSessionClientWSocket ReceiveStr =>

[twsocket] SocketSpy Re-Reply

2005-11-01 Thread ICSNewbie2005
Hi Mr. Wilfried M., Yes below is code I am talking about =), When i went to compile though it say Incompatible types. Client which is of Type (TClient) and the assignment to wSocketServer.Client[] which is of Type (TWSocketClient). Lol i did not know sending data to 2 different connection make so h

Re: [twsocket] transmission stress test

2005-11-01 Thread Wilfried Mestdagh
Hello David, I suggest to first see if the sender or the receiver fails. you can easy do that if you hang SocketSpy (user made) between them. > Line 4117: Received -1 bytes, Remaining 3123 bytes > Line 4118: WARNING! Transfer went wrong! Error 0 No nothing went nececary wrong. Ignore 0 and -1, j

Re: [twsocket] transmission stress test

2005-11-01 Thread Kei
I'm Sorry! I thought the code was too big to attach.. anyway here it is My component "TSession" is a descendent from the TWCliSocket. WaitStatus is a public property, that states what "state" the class is currently at. David procedure TSession.MyDataAvailable(Sender: TOb

Re: [twsocket] transmission stress test

2005-11-01 Thread Francois PIETTE
> I asked about a method to recognize the "splitted packets" and to join > them upon arrival of the last one. So far my protocol works fine, and This is really the most common task when dealing with TCP transmission. You have such "packet reassembly" in almost all ICS components. TWSocket itself

[twsocket] transmission stress test

2005-11-01 Thread Kei
Hi, this is David. I asked about a method to recognize the "splitted packets" and to join them upon arrival of the last one. So far my protocol works fine, and all the data is assembled in an orderly manner. For large texts or binary data, the clients knows how to handle it as follows: The "Red