Re: [Gambas-user] server socket problem

2009-05-28 Thread Ron_1st
On Monday 25 May 2009, guiodic wrote: Ron_1st wrote: No, this is not correct. My internet connection is 20Mbits (20/8 = 2500 KByte/second) When I write 1Kb (8kbit) it goes with 20Mbs speed on the wire. Using packets of 1 KByte every second is a transfer rate (bandidth) The

Re: [Gambas-user] server socket problem

2009-05-25 Thread guiodic
Ron_1st wrote: No, this is not correct. My internet connection is 20Mbits (20/8 = 2500 KByte/second) When I write 1Kb (8kbit) it goes with 20Mbs speed on the wire. Using packets of 1 KByte every second is a transfer rate (bandidth) The average is then the wished 1 Kbits using 1/2500

[Gambas-user] server socket problem

2009-05-24 Thread guido iodice
Hi to all! I have a problem with server socket. I made a little http server with Gambas. This server must send large file, so it read 1KB from the file, write it and wait. The wait is calculated to fit the max band chosed by the server administrator. So if the max band is 1KB/s the pause is 1

Re: [Gambas-user] server socket problem

2009-05-24 Thread Benoît Minisini
Hi to all! I have a problem with server socket. I made a little http server with Gambas. This server must send large file, so it read 1KB from the file, write it and wait. The wait is calculated to fit the max band chosed by the server administrator. So if the max band is 1KB/s the pause

Re: [Gambas-user] server socket problem

2009-05-24 Thread guiodic
Benoît Minisini wrote: The WRITE instruction will block your program if the internal socket buffer is full because the reader is not fast enough to get it. Thank you Benoit. But, how can to workaround this? -- View this message in context:

Re: [Gambas-user] server socket problem

2009-05-24 Thread Benoît Minisini
Benoît Minisini wrote: The WRITE instruction will block your program if the internal socket buffer is full because the reader is not fast enough to get it. Thank you Benoit. But, how can to workaround this? You raise a point there. There is no code in the gb.net component to warn when

Re: [Gambas-user] server socket problem

2009-05-24 Thread guiodic
Benoît Minisini wrote: I'm afraid I won't be able to fix that for Gambas 2.x. Regards, -- Benoît :( Well, thank you. -- View this message in context: http://www.nabble.com/server-socket-problem-tp23697722p23698223.html Sent from the gambas-user mailing list archive at

Re: [Gambas-user] server socket problem

2009-05-24 Thread Benoît Minisini
Benoît Minisini wrote: I'm afraid I won't be able to fix that for Gambas 2.x. Regards, -- Benoît :( Well, thank you. But you can enhance your code by fixing your WAIT pause instruction. If WRITE blocks, then you must take its execution time into account, and lower the pause

Re: [Gambas-user] server socket problem

2009-05-24 Thread guiodic
Benoît Minisini wrote: But you can enhance your code by fixing your WAIT pause instruction. If WRITE blocks, then you must take its execution time into account, and lower the pause accordingly. Regards, -- Benoît oh. yes! I can measure the WRITE execution time.

Re: [Gambas-user] server socket problem

2009-05-24 Thread guiodic
guiodic wrote: This is the solution, I think. Damn, It doesn't work. I have modified the code: I put print timer() before and after the WRITE: PRINT Timer() WRITE #LAST, b, Len(b) WAIT pausa PRINT Timer() with pause=0.5 (=2kb/s) and wget set for 1 kb/s well, this is the output:

Re: [Gambas-user] server socket problem

2009-05-24 Thread guiodic
Ok, this is the test: code: tempo = Timer() WRITE #LAST, b, Len(b) WAIT pausa tempo = Timer() - tempo ' tempo di esecuzione della WRITE in s PRINT tempo where: pausa= 1/5 s = 0.20 then max transer rate is 5 kb/s wget wget --limit-rate=1k This is (part of) the output: 0,2031