mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Feb 2003
Posts: 307
T
tontito Offline OP
Fjord artisan
OP Offline
Fjord artisan
T
Joined: Feb 2003
Posts: 307
Hello to you all,

Did any of you noticed TCP sockets take more time to send data?
I notice this even for small amounts of data (400 bytes)

Because of this i can't reach transfer rates higher then 160kB/s with my addons.

Best regards

Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
160kb/s for 400bytes? That doesn't even make sense.

Can you be more specific about what you mean by small amounts of data? Or how you're even measuring this?


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Joined: Dec 2002
Posts: 5,412
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,412
Please provide a short script that we can use to test/reproduce this issue.

Joined: Feb 2003
Posts: 307
T
tontito Offline OP
Fjord artisan
OP Offline
Fjord artisan
T
Joined: Feb 2003
Posts: 307
Hi,

Plz check code below.

While running on 7.14 i always get:
Data sent, waiting for flush 389 bytes

when running on 7.1 i get
Data sent, waiting for flush 0 bytes

It seems that on 7.14 the sockets aren't flushing as fast as they did before.

Best regards


alias socket_test {
sockopen scans_p1 forums.mirc.com 80
}


on *:sockopen:scans_p*: {
if ($sockerr) { echo -a can't connect to server | return }

set %testvar $ticks

sockwrite -n $sockname GET /ubbthreads.php?ubb=postlist&Board=8 HTTP/1.0
sockwrite -n $sockname Host: forums.mirc.com
sockwrite -n $sockname Accept: text/html, application/xml;q=0.9, application/xhtml+xml, image/png, image/jpeg, image/gif, image/x-xbitmap, */*;q=0.1
sockwrite -n $sockname Accept-Language: pt-PT,pt;q=0.9,en;q=0.8
sockwrite -n $sockname Accept-Charset: iso-8859-1, utf-8, utf-16, *;q=0.1
sockwrite -n $sockname Accept-Encoding: deflate, gzip, x-gzip, identity, *;q=0
sockwrite -n $sockname Connection: close
sockwrite -n $sockname $crlf

echo Data sent, waiting for flush $sock($sockname).sq bytes

.timerwaits $+ $sockname -mo 0 1 waitToSend $sockname
}

alias -l waitToSend {
if ($timer(waits $+ $1)) {

if ($sock($1).sq > 0) {
return
}

echo Data finally sent in $calc($ticks - %testvar) for $version
sockclose $1
.timerwaits $+ $1 off
}
}


on *:sockread:scans_p*: {
}

on *:sockclose:scans_p*: {
echo socket closed in $calc($ticks - %testvar) for $version
}

Joined: Dec 2002
Posts: 5,412
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,412
The /sockwrite command now queues data to be sent and a separate routine handles the actual sending of data. So the result of $sock($sockname).sq is expected if it is queried immediately after using /sockwrite.

That does not seem to reproduce the issue you mentioned about data not being sent as fast as before. Can you provide a script that reproduces the speed issue?

Joined: Feb 2003
Posts: 307
T
tontito Offline OP
Fjord artisan
OP Offline
Fjord artisan
T
Joined: Feb 2003
Posts: 307
Not a small script smile

If you would like, you can test my web server with both versions.
Do we have a way to flush the data right away? Or a switch for /sockwrite?

best regards

Joined: Dec 2002
Posts: 5,412
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,412
Thanks, I was able to reproduce the issue. I have changed /sockwrite in the next version to send data more quickly.


Link Copied to Clipboard