Sorry about lack of information...
Making some tests, I identified there's no problem with bandwidth limitation 
code for normal connections, only with SSL connections.
This is a exemple source code made in Delphi, coded at a button's click 
event. You can use the e-mail information unmodified, because it's valid and 
I send a large mail to it for test purposes. Please do not modify pop3.Top 
to pop3.Retr, because this will make the first message to be unavailable 
after a sucessful retrieve (gmail implements this as default and cannot be 
changed). And TOP command, even if it drop all message data, do not turn the 
message unavailable for download in the next pop3 session you start.
I already tested with pop3.retr, but results are the same.


procedure TForm1.Button1Click(Sender: TObject);
var pop3:TPOP3Send;
begin
  pop3:=TPOP3Send.Create;
  pop3.Sock.MaxBandwidth:=4096;
  pop3.TargetHost:='pop.gmail.com';
  pop3.TargetPort:='995';
  pop3.Username:='synapsetest';
  pop3.Password:='456789a';
  pop3.FullSSL:=true;
  pop3.AuthType:=POP3AuthAll;
  if pop3.Login then begin
     pop3.Top(1,26214400);
  end;
  pop3.Logout;
  pop3.Free;
end;

I use ssl_openssl.pas unit and the respective dlls. Only when I use a SSL 
connection (pop3.FullSSL = true) the bandwidth limit isn't working. I tested 
in a server with normal connections and bandwidth limit works well (but I 
note what Lukas mentioned about read all packet data without limitation, and 
then limit bandwidth between packets, giving to the download history peaks 
when a packet is readed). Anyway, for non-SSL connections bandwidth limit 
works fine, only SSL-based pop3 connections are ignoring bandwidth limit.
If you need a program to monitor download/upload history, I suggest to use 
NetMeter, a free software which can be downloaded at 
http://readerror.gmxhome.de/
I investigate OnStatus hook and no HR_Wait signal is sended at all to this 
event in a SSL connection, only when using normal connections. I'm sure the 
download speed is above 4 KB/s (as I defined in the example as bandwidth 
limit), looking on download history provided by NetMeter (the average speed 
was about 70 KB/s).
So, you can confirm that what I said about SSL is true and, in that case, 
what is my options to implement bandwidth limit when using SSL connections?



Maykon

----- Original Message ----- 
From: "Lukas Gebauer" <[EMAIL PROTECTED]>
To: "Ararat Synapse" <[email protected]>
Sent: Tuesday, February 13, 2007 4:11 PM
Subject: Re: [Synalist] Fw: Bandwidth Limit in TPOP3Send class


>> My knowledge in low-level TCP/IP isn't very good, but I don't think all
>> data are sended in one packet in my case. I use the TOP command because a
>> RETRIEVE, in some servers, mark e-mails as read and not list it anymore
>> after a successful retrieve. To avoid this, I send a TOP command with a
>> high line count, so all data are dropped with TOP command. I tested
>> bandwidth limit using a 12 MB message, which I don't think can be send in
>> a single TCP packet, and the bandwidth limit doesn't work at all. So,
>> presuming that my TOP request isn't a single TCP packet operation, how I
>> can implement bandwidth limit (or can be implemented in Synapse classes)?
>
> If you want to see how data is realy readed by socket, use OnStatus hook.
>
> Anyway, I really cannot know where you have a problem. Bandwidth
> limitation code is implemented on very low-level inside synapse, and can
> be used by all sockets inside Synapse. POP3send is not exception.
>
> I can only speculate what is wrong, because you not provide any detailed
> informations. Are you sure if you are setting bandwidth limit correctly?
>
> Use OnStatus hook, see for HR_read and HR_wait events. It is best start
> for debugging.
>
> --
> Lukas Gebauer.
>
> E-mail: [EMAIL PROTECTED]
> WEB: http://www.ararat.cz/synapse - Synapse Delphi and Kylix TCP/IP
> Library
>
>
>
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job 
> easier.
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> synalist-public mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/synalist-public
> 



                
_______________________________________________________ 
Yahoo! Mail - Sempre a melhor opção para você! 
Experimente já e veja as novidades. 
http://br.yahoo.com/mailbeta/tudonovo/
 



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
synalist-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/synalist-public

Reply via email to