Re: [fpc-pascal] socket timeout

2013-04-17 Thread Xiangrong Fang
Will this be a CPU hog: t := Now; while fprecv(s, @buf, buf_len, MSG_DONTWAIT) < 0 do begin if Now - t > 0.1 * timeout then Break; // approx. seconds end; Thanks 2013/4/16 Luca Olivetti > Al 16/04/13 12:20, En/na Michael Schnell ha escrit: > > On 04/16/2013 11:26 AM, Xiangrong Fang

Re: [fpc-pascal] socket timeout

2013-04-17 Thread Rainer Stratmann
On Wednesday 17 April 2013 09:17:09 you wrote: > Will this be a CPU hog: > > t := Now; > while fprecv(s, @buf, buf_len, MSG_DONTWAIT) < 0 do begin > if Now - t > 0.1 * timeout then Break; // approx. seconds > end; > > Thanks I did not read the whole thread, but that you favorite blocki

Re: [fpc-pascal] socket timeout

2013-04-17 Thread Xiangrong Fang
I thought MSG_DONTWAIT is actually the flag to switch to nonblocking mode, isn't it? As a matter of fact, the fprecv() above would get a result of -1 and a sockterror of "Try Again", which is exactly the behavior of nonblocking read. 2013/4/17 Rainer Stratmann > On Wednesday 17 April 2013 09:

Re: [fpc-pascal] Same code from LCL project throw error in console application

2013-04-17 Thread José Mejuto
El 16/04/2013 22:46, Krzysztof escribió: Thanks! exInvalidOp exception mask solved problem. But I don't understand. Same error I had in fpGUI project. fpGUI interface doesn't use GTK, QT etc, it drawing over pure X11 so how it is possible that application catch GTK errors? Hello, Almost any '

[fpc-pascal] Re: Correct way for partial generic specialization

2013-04-17 Thread leledumbo
> You're missing the again. :) *self-headcut > Not currently. It might be a useful extension however. I'll need to test > what Delphi says about this... OK, I'll wait -- View this message in context: http://free-pascal-general.1045716.n5.nabble.com/Correct-way-for-partial-generic-specializ

Re: [fpc-pascal] Re: Correct way for partial generic specialization

2013-04-17 Thread Sven Barth
Am 17.04.2013 11:11, schrieb leledumbo: You're missing the again. :) *self-headcut Can it be that your E-Mail client misinterprets the "<...>" (with only one string as "value") as HTML tags? Because I can't see the "" I had written to you in your quotation. Not currently. It might be a

[fpc-pascal] Fpcup for FreeBSD: feedback welcome

2013-04-17 Thread Reinier Olislagers
Just uploaded a new version of fpcup (automatic FPC+Lazarus svn downloader/installer for both stable and trunk) at https://bitbucket.org/reiniero/fpcup/downloads I welcome feedback from FreeBSD users - the binary should work on FreeBSD 9 x64... For the Lazarus installation part, it picks up newer/

Re: [fpc-pascal] socket timeout

2013-04-17 Thread Rainer Stratmann
On Wednesday 17 April 2013 10:22:58 you wrote: > I thought MSG_DONTWAIT is actually the flag to switch to nonblocking mode, > isn't it? May be. > As a matter of fact, the fprecv() above would get a result of -1 > and a sockterror of "Try Again", which is exactly the behavior of > nonblocking read.

Re: [fpc-pascal] socket timeout

2013-04-17 Thread Fabio Luis Girardi
For connect, I wrote a unit that implements a connect timeout, see: http://sourceforge.net/p/pascalscada/code/HEAD/tree/trunk/src/scada/sockets_w32_w64.pas#l70 or http://sourceforge.net/p/pascalscada/code/HEAD/tree/trunk/src/scada/sockets_unix.pas#l48 If you want work in blocking mode after con

[fpc-pascal] How can retrive value from OUT parameter?

2013-04-17 Thread Toru Takubo
Hi All, I have an application build with Delphi7+ADO connecting to MSSQL database, and planning to migrate to FPC+SQLdb. It has many stored procedures which have OUT parameters to retrieve value from database. I am trying to migrate by using TMSSQLConnection+TSQLQuery, but still I can not settle

[fpc-pascal] Bending System.IndexByte to my will!!?

2013-04-17 Thread Reinier Olislagers
Hi all, (FPC 2.6.2 x86, trunk x64, on Windows; found similar behaviour on Linux x64) Busy getting DBase III memo support correct ;) In fcl-db\src\dbase\dbf_common.pas we find this part used to e.g. find end of file ($1A/ASCII 26) markers in a buffer with memo data: [1] The problem is: the first

Re: [fpc-pascal] Bending System.IndexByte to my will!!?

2013-04-17 Thread Jeppe Græsdal Johansen
Den 18-04-2013 07:57, Reinier Olislagers skrev: Hi all, (FPC 2.6.2 x86, trunk x64, on Windows; found similar behaviour on Linux x64) Busy getting DBase III memo support correct ;) In fcl-db\src\dbase\dbf_common.pas we find this part used to e.g. find end of file ($1A/ASCII 26) markers in a buf

Re: [fpc-pascal] Bending System.IndexByte to my will!!?

2013-04-17 Thread Reinier Olislagers
On 18-4-2013 8:14, Jeppe Græsdal Johansen wrote: > Den 18-04-2013 07:57, Reinier Olislagers skrev: >> In fcl-db\src\dbase\dbf_common.pas we find this part used to e.g. find >> end of file ($1A/ASCII 26) markers in a buffer with memo data: [1] >> >> The problem is: the first MemScan function doesn't

Re: [fpc-pascal] How to use TThread?

2013-04-17 Thread Antonio Fortuny
First of all change the order of lines 25-26     inherited Create(False);     FreeOnTerminate := True; instead of     FreeOnTerminate := True;     inherited Create(False); The, drop the DoExecute procedure and replace it by the Execute