Speed I really can provide
Moderator: Moderators
Speed I really can provide
Is it possible to fight those people who don't write truth about their speed with such a feature, that would check real speed of download/upload, everything during using, without any possibility of change made by user ???
YES
---------------------------------------------------------------------------
#include <stdio.h>
#include <conio.h>
#include <afxinet.h>
#include <wininet.h>
main()
{
int hora,horafinal,final,abits,conexion,cs;
printf("hit 1 if modem and 0 if better: ");
scanf("%d",&cs);
fflush(stdin);
HINTERNET hSession;
hSession = InternetOpen("MyApp", INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0);
if (hSession)
{
HINTERNET hService;
hService = InternetConnect(hSession, "ftp.idsoftware.com",
INTERNET_DEFAULT_FTP_PORT, "anonymous", "[email protected]",
INTERNET_SERVICE_FTP, 0, 0);
if (hService)
{
CTime date(CTime::GetCurrentTime());
hora = date.GetTime();
BOOL gFile;
if (cs=0)
{
gFile = FtpGetFile(hService, "/idstuff/source/q2source-3.21.zip", "c:/deleteme.txt", 0, 0, FTP_TRANSFER_TYPE_BINARY, 0);
}
else
{
gFile = FtpGetFile(hService, "/idstuff/source/doomsrc.zip", "c:/d.txt", 0, 0, FTP_TRANSFER_TYPE_BINARY, 0);
}
DWORD error_no = GetLastError();
if (cs=0)
{
CTime da(CTime::GetCurrentTime());
horafinal = da.GetTime();
final=horafinal-hora;
abits=1477764*8;
conexion=abits/final;
}
else
{
CTime da(CTime::GetCurrentTime());
horafinal = da.GetTime();
final=horafinal-hora;
abits=362698*8;
conexion=abits/final;
}
}
InternetCloseHandle(hService);
}
InternetCloseHandle(hSession);
//printf(final);
printf("connection speed: ");
printf("%i bps ",conexion);
}
------------------------------------------------------------------------------
compile with : project settings>>C/C++ category:code generation >> use run time library=debug multythreaded
YES
---------------------------------------------------------------------------
#include <stdio.h>
#include <conio.h>
#include <afxinet.h>
#include <wininet.h>
main()
{
int hora,horafinal,final,abits,conexion,cs;
printf("hit 1 if modem and 0 if better: ");
scanf("%d",&cs);
fflush(stdin);
HINTERNET hSession;
hSession = InternetOpen("MyApp", INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0);
if (hSession)
{
HINTERNET hService;
hService = InternetConnect(hSession, "ftp.idsoftware.com",
INTERNET_DEFAULT_FTP_PORT, "anonymous", "[email protected]",
INTERNET_SERVICE_FTP, 0, 0);
if (hService)
{
CTime date(CTime::GetCurrentTime());
hora = date.GetTime();
BOOL gFile;
if (cs=0)
{
gFile = FtpGetFile(hService, "/idstuff/source/q2source-3.21.zip", "c:/deleteme.txt", 0, 0, FTP_TRANSFER_TYPE_BINARY, 0);
}
else
{
gFile = FtpGetFile(hService, "/idstuff/source/doomsrc.zip", "c:/d.txt", 0, 0, FTP_TRANSFER_TYPE_BINARY, 0);
}
DWORD error_no = GetLastError();
if (cs=0)
{
CTime da(CTime::GetCurrentTime());
horafinal = da.GetTime();
final=horafinal-hora;
abits=1477764*8;
conexion=abits/final;
}
else
{
CTime da(CTime::GetCurrentTime());
horafinal = da.GetTime();
final=horafinal-hora;
abits=362698*8;
conexion=abits/final;
}
}
InternetCloseHandle(hService);
}
InternetCloseHandle(hSession);
//printf(final);
printf("connection speed: ");
printf("%i bps ",conexion);
}
------------------------------------------------------------------------------
compile with : project settings>>C/C++ category:code generation >> use run time library=debug multythreaded
-
- Posts: 32
- Joined: 2003-12-12 14:28
- Location: FL,USA
- Contact:
I dont know c but im guessing that code connects to an ftp and downloads a file and returns the speed of the download. WOW what a horible way to judge speed. for one theres no upload test from what i can tell wich would be the thing really that would be good to know and there is also way to many factors. for 1 do you know how many people use dc++ what if 50 people with 500KB/s download run that 'test' at the same time. even if that where fixable through some queuing system this in my opinion would still be quite useless.
Tim-
Tim-
Re: Speed I really can provide
What I mean:
Code: Select all
#include <stdio.h>
#include <conio.h>
#include <afxinet.h>
#include <wininet.h>
main()
{
int hora,horafinal,final,abits,conexion,cs;
printf("hit 1 if modem and 0 if better: ");
scanf("%d",&cs);
fflush(stdin);
HINTERNET hSession;
hSession = InternetOpen("MyApp", INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0);
if (hSession)
{
HINTERNET hService;
hService = InternetConnect(hSession, "ftp.idsoftware.com",
INTERNET_DEFAULT_FTP_PORT, "anonymous", "[email protected]",
INTERNET_SERVICE_FTP, 0, 0);
if (hService)
{
CTime date(CTime::GetCurrentTime());
hora = date.GetTime();
BOOL gFile;
if (cs=0)
{
gFile = FtpGetFile(hService, "/idstuff/source/q2source-3.21.zip", "c:/deleteme.txt", 0, 0, FTP_TRANSFER_TYPE_BINARY, 0);
}
else
{
gFile = FtpGetFile(hService, "/idstuff/source/doomsrc.zip", "c:/d.txt", 0, 0, FTP_TRANSFER_TYPE_BINARY, 0);
}
DWORD error_no = GetLastError();
if (cs=0)
{
CTime da(CTime::GetCurrentTime());
horafinal = da.GetTime();
final=horafinal-hora;
abits=1477764*8;
conexion=abits/final;
}
else
{
CTime da(CTime::GetCurrentTime());
horafinal = da.GetTime();
final=horafinal-hora;
abits=362698*8;
conexion=abits/final;
}
}
InternetCloseHandle(hService);
}
InternetCloseHandle(hSession);
//printf(final);
printf("connection speed: ");
printf("%i bps ",conexion);
}
-
- DC++ Contributor
- Posts: 3212
- Joined: 2003-01-07 21:46
- Location: .pa.us
I personally think this would end up being a waste of time, and most of the time the information would be completely unreliable.
At least don't reinvent the wheel though. http://www.ncne.org/software/tools/tcp.html
At least don't reinvent the wheel though. http://www.ncne.org/software/tools/tcp.html
My Visual Studio .NET 2003 is licensed under my name, and the same for my operating system... What about you?
I surf on an OC3 without limitations, two to be exact, and I'm not joking.
I surf on an OC3 without limitations, two to be exact, and I'm not joking.
That's a pretty big if...
This would never work. I can provide speeds of 800k/s+ to users on the hub that I run on my local university network. IF I were to connect to other hubs, CIS has this nice 'feature' called 'packetshaping.' So I'd be uploading/downloading to public hubs at a measly 2k/s
Maybe we need an option that says:
Maybe we need an option that says:
OC3 Connection, but CIS (or IT) sucks ass.