On 2013-09-18 09:20, Michael Van Canneyt wrote:
The fptimer unit implements a timer with a thread, but this forces the use of
threads on your application
The way I like it! ;-) Especially considering how thread friendly these
[common place] multi-core CPU's are these days.
Regards,
-
Conclusion:
Thus we could draft a living noGUI TCustomApplication sibling (aka
LCL WidgetType), that allows for firing MainThread Events triggered
from (a newly implemented) TTimer, TThread.Queue(),
TThread.Synchronize(), TApplication.QueueAsyncCall() and the legacy
windowish PostMessage() -
On Wed, 18 Sep 2013 09:32:54 +0200
Michael Schnell mschn...@lumino.de wrote:
[...]
It is really frustrating to see, that this now seems to solves the issue
I am hunting for since some five years.
Has it ever come to your mind that hunting might not be sufficient to
create code?
Over the
On 18.09.2013 10:00, Michael Schnell wrote:
On 09/18/2013 09:53 AM, Sven Barth wrote:
I wouldn't use the timeout constant for this. If you have two timers
of which the greatest common denominator is 1, but nevertheless rather
large (e.g. two primes) then you'd loop unnecessarily (I know this
On Wed, 18 Sep 2013, Sven Barth wrote:
On 18.09.2013 09:32, Michael Schnell wrote:
- TTimer is implemented including defining the timeout constant for
calls to CheckSynchronize() as the greatest common denominator of the
Time property of all enabled TTimer instances in the project (i.e. a
On 09/18/2013 10:05 AM, Mattias Gaertner wrote:
On Wed, 18 Sep 2013 09:32:54 +0200
Michael Schnell mschn...@lumino.de wrote:
[...]
Instead I was told that I should look at the LCL
source code and that in Windows, the Event queuing mechanism is done by
Windows itself and in Linux it is done
On Wed, 18 Sep 2013 10:25:43 +0200
Michael Schnell mschn...@lumino.de wrote:
On 09/18/2013 10:05 AM, Mattias Gaertner wrote:
On Wed, 18 Sep 2013 09:32:54 +0200
Michael Schnell mschn...@lumino.de wrote:
[...]
Instead I was told that I should look at the LCL
source code and that in
On 09/18/2013 10:38 AM, Mattias Gaertner wrote:
On Wed, 18 Sep 2013 10:25:43 +0200
Michael Schnell mschn...@lumino.de wrote:
What non-GUI events - additionally to the events I mentioned - would be
needed for the whole event system of the LCL ?
For example PostMessage can send messages to
Al 18/09/13 09:32, En/na Michael Schnell ha escrit:
It is really frustrating to see, that this now seems to solves the issue
I am hunting for since some five years.
Perhaps if you spent your time actually using fpc instead of hunting for
non-problems you'd have realized that this worked five
On Wed, 18 Sep 2013 10:55:34 +0200
Michael Schnell mschn...@lumino.de wrote:
On 09/18/2013 10:38 AM, Mattias Gaertner wrote:
On Wed, 18 Sep 2013 10:25:43 +0200
Michael Schnell mschn...@lumino.de wrote:
What non-GUI events - additionally to the events I mentioned - would be
needed for
In our previous episode, Michael Schnell said:
The fptimer unit implements a timer with a thread, but this forces the
use of threads on your application which is not always desirable.
Should be doable, as well. AFAIK, mse (for Linux) uses signals on that
behalf. We might want to steal
On 09/18/2013 01:26 PM, Marco van de Voort wrote:
While there is sigalarm, but can you have multiple independent timers
in an application that way?
I don't know. We would need to ask mse.
-Michael
___
fpc-pascal maillist -
On Wed, Sep 18, 2013 at 01:26:46PM +0200, Marco van de Voort wrote:
In our previous episode, Michael Schnell said:
The fptimer unit implements a timer with a thread, but this forces the
use of threads on your application which is not always desirable.
Should be doable, as well. AFAIK,
In our previous episode, Sven Barth said:
forced to by hand use Windows messages to schedule asynchronous Main
Thread events.
TThread.Queue is a rather new addition. Delphi 2009 if I'm correct. So
that's definitely not very early.
D2006 afaik.
On 09/18/2013 05:03 PM, Sven Barth wrote:
TThread.Queue is a rather new addition. Delphi 2009 if I'm correct. So
that's definitely not very early.
OK, at least four years ;-) .
I have Turbo Delphi. Here it is implemented but not to be found in the
help.
-Michael
On Wed, Sep 18, 2013 at 03:57:36PM +0200, Marco van de Voort wrote:
In our previous episode, Henry Vermaak said:
Should be doable, as well. AFAIK, mse (for Linux) uses signals
on that behalf. We might want to steal some ideas there.
While there is sigalarm, but can you have
On 09/13/2013 07:08 PM, Sven Barth wrote:
As we have already written in some previous mails to there is a global
event procedure to wake up the main thread that is triggered when
something is queued. The LCL uses this already and other programs
could use a TEvent or whatever.
Could you
In our previous episode, Michael Schnell said:
As we have already written in some previous mails to there is a global
event procedure to wake up the main thread that is triggered when
something is queued. The LCL uses this already and other programs
could use a TEvent or whatever.
On 09/16/2013 11:14 AM, Marco van de Voort wrote:
If you mean integrate with your own eventloop, then yes, make sure
that your idle event in your eventloop calls checksyncrhonize
OK, so checksynchronize() is the correct name of the RTL-provided
function that pulls the event queue. (Sorry that
In our previous episode, Michael Schnell said:
OK, so checksynchronize() is the correct name of the RTL-provided
function that pulls the event queue. (Sorry that the correct name
escaped from my silly brain.)
Yes, it is the connection between VCL and RTL for this kind of stuff.
AFAIU this
On 09/16/2013 01:22 PM, Marco van de Voort wrote:
The non-LCL one must simply call checksynchronize as the blocking part
of the mainthread's eventloop.
Thus, my wish already seems to be fulfilled.
Great !
there is no LCL dependence in theory, but other eventloop systems
might assume they
Am 16.09.2013 10:58, schrieb Michael Schnell:
On 09/13/2013 07:08 PM, Sven Barth wrote:
As we have already written in some previous mails to there is a
global event procedure to wake up the main thread that is triggered
when something is queued. The LCL uses this already and other
programs
Am 16.09.2013 13:22, schrieb Marco van de Voort:
Did I understand you correctly that there is a notifying procedure,
that is called by the Event queuing mechanism each time an event is
pushed onto the queue ?
That was not me, but Sven or sb else. But as I understood it, the queue
method does
Am 16.09.2013 13:38, schrieb Michael Schnell:
there is no LCL dependence in theory, but other eventloop systems
might assume they themselves implement the blocking part. (e.g. to
wake up because of OS messages) Services, console network server
implementations etc probably already do that both
On 09/16/2013 02:03 PM, Sven Barth wrote:
CheckSynchronize has a timeout parameter:
http://www.freepascal.org/docs-html/rtl/classes/checksynchronize.html
Great !
Maybe the docs should be updated and mention TThread.Queue, which for me
is most important, as it - finally - allows for decent
On 09/16/2013 02:01 PM, Sven Barth wrote:
WakeMainThread
Thanks for the pointer.
I'll take another look there.
-Michael
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
On 09/16/2013 02:01 PM, Sven Barth wrote:
( http://www.freepascal.org/docs-html/rtl/classes/wakemainthread.html ).
IIRC, TThread.Queue does this, as well.
Thus updating this page might be appropriate...
Thanks,
-Michael
___
fpc-pascal maillist -
Thanks for the clear information.
Enhanced by the knowledge about TThread.queue It will allow me to do
some nice tricks.
-Michael
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
On Thursday, September 12, 2013 7:14 AM, Michael Schnell mschn...@lumino.de
wrote:
On 09/12/2013 12:47 PM, Mark Morgan Lloyd wrote:
I've concluded that using a thread is, in fact, preferable
True.
It's a pity that Synapse and friend (especially SynaSer) does does not
implement
On 09/13/2013 06:06 AM, wkitt...@windstream.net wrote:
would this hamper or cause problems with normal non-gui programs using
the library?
1) This feature of course should only be provided additionally to the
functions we know and love.
2) Other than the work-alike
Am 13.09.2013 10:47 schrieb Michael Schnell mschn...@lumino.de:
On 09/13/2013 06:06 AM, wkitt...@windstream.net wrote:
would this hamper or cause problems with normal non-gui programs using
the library?
1) This feature of course should only be provided additionally to the
functions we know
On 09/11/2013 07:22 PM, Mark Morgan Lloyd wrote:
I'd normally use a thread for this, but I've already got lnet's telnet
client running in the program so would rather stick to the same
library if possible.
AFAIK, Lnet does not do threading internally (as does AsyncPro or -
partly - Indy),
Michael Schnell wrote:
On 09/11/2013 07:22 PM, Mark Morgan Lloyd wrote:
I'd normally use a thread for this, but I've already got lnet's telnet
client running in the program so would rather stick to the same
library if possible.
AFAIK, Lnet does not do threading internally (as does AsyncPro
Mark Morgan Lloyd wrote:
Is it feasible to use lnet for a simple TCP daemon on Linux, i.e. wait
for a connection on a predefined port, read as much data as is
available, repeat? And if so, what does the SerSock parameter to
Accept() represent?
I'd normally use a thread for this, but I've
Mark Morgan Lloyd wrote:
Michael Schnell wrote:
On 09/11/2013 07:22 PM, Mark Morgan Lloyd wrote:
I'd normally use a thread for this, but I've already got lnet's
telnet client running in the program so would rather stick to the
same library if possible.
AFAIK, Lnet does not do threading
On 09/12/2013 12:47 PM, Mark Morgan Lloyd wrote:
I've concluded that using a thread is, in fact, preferable
True.
It's a pity that Synapse and friend (especially SynaSer) does does not
implement internal threads that throw appropriate events in the Main
Thread when something comes in (or
On Thu, 12 Sep 2013, Michael Schnell wrote:
On 09/12/2013 12:47 PM, Mark Morgan Lloyd wrote:
I've concluded that using a thread is, in fact, preferable
True.
It's a pity that Synapse and friend (especially SynaSer) does does not
implement internal threads that throw appropriate events
Michael Schnell wrote:
On 09/12/2013 12:47 PM, Mark Morgan Lloyd wrote:
I've concluded that using a thread is, in fact, preferable
True.
It's a pity that Synapse and friend (especially SynaSer) does does not
implement internal threads that throw appropriate events in the Main
Thread when
In our previous episode, Mark Morgan Lloyd said:
common request, and since the fpc-Team some time ago enabled
TThread.Queue in the RTL, this is doable in a straight forward,
fpc-ish way (portable but Delphi compatible).
Although for certain types of usage being able to get directly to
On 09/12/2013 01:28 PM, Michael Van Canneyt wrote:
The very reason I use Synapse is that it DOES NOT use threads.
Synapse is simple to use. Keep it so.
Of course I don't vote for Synapse always using threads, but to provide
_additional_ functions / objects (maybe units) that work similar to
In our previous episode, Michael Schnell said:
The very reason I use Synapse is that it DOES NOT use threads.
Synapse is simple to use. Keep it so.
Of course I don't vote for Synapse always using threads, but to provide
_additional_ functions / objects (maybe units) that work similar to
On 09/12/2013 02:45 PM, Marco van de Voort wrote:
E.g. TComport only starts an helper thread if you register receive
events. If you do not, you can use it in a select/waitformultiple like
way in a thread.
Sounds good.
I'm going to test this ASAP.
-Michael
Is it feasible to use lnet for a simple TCP daemon on Linux, i.e. wait
for a connection on a predefined port, read as much data as is
available, repeat? And if so, what does the SerSock parameter to
Accept() represent?
I'd normally use a thread for this, but I've already got lnet's telnet
I use the console example lserver.pp in LNet and it works fine that way.
However, when I modified it to have 2 listening socket (TLTCP) listen
one after another , and in the run loop,
repeat
socket1.CallAction;
socket2.CallAction;
until Quit1 or Quit2;
Only the first socket
2012/2/1 Malcolm Poole malc...@lingua-z.co.uk:
Before I set out to implement the procedures to do this myself, can someone
reassure me that this needs to be done and that I am not re-inventing the
wheel?
The TCP protocol will transparently split the data into the packets of
needed size without
2012/2/4 Bernd prof7...@googlemail.com:
You need a robust way to determine how long your
protocol message is, at which byte exactly it ends and the next
message begins.
The simplest way would probably be if you prepend all your messages
with a length field and a checksum field to be sent as
On 04/02/12 14:14, Bernd wrote:
2012/2/4 Berndprof7...@googlemail.com:
You need a robust way to determine how long your
protocol message is, at which byte exactly it ends and the next
message begins.
The simplest way would probably be if you prepend all your messages
with a length field and a
I'm working on a client/server project which involves sending SQL
commands from server to client and vice versa.
I've been using the LTCP component for both the client and the server,
which have been working perfectly during testing on the same machine and
between different virtual machines,
On Thu, 7 Oct 2010 16:00:31 -0700 Brian Winfrey wrote:
Here are the modifications I made in exploring this issue:
It works on:
-
% uname -a
FreeBSD host.ipt.ru 9.0-CURRENT FreeBSD 9.0-CURRENT #3 r213198M: Mon Sep 27
15:43:54 MSD 2010 b...@host.ipt.ru:/usr/obj/usr/src/sys/HOST i386
I didn't try it, but I see that it tries to connect to google's dns serve=
r,
so it'd fail miserably if the computer has no internet access.
Bye
--
Luca
I tested, without web access does not work. :o
A hard coded address will of course fail if it cannot be reached.
The code was an
In our previous episode, Brian Winfrey said:
I found an example for linux on stack overflow that was in c
http://stackoverflow.com/questions/212528/linux-c-get-the-ip-address-of-local-computer
Compiles on FreeBSD and the result looks sane (but on a system that has a
routable address)
Wow, worked perfectely in Ubuntu-10.04, Mandriva-2010 and openSUSE-11.2.
Thanks for the exelent solutions. :)
2010/10/7 Brian Winfrey bwcod...@gmail.com
I found an example for linux on stack overflow that was in c
En/na Marco van de Voort ha escrit:
In our previous episode, Brian Winfrey said:
I found an example for linux on stack overflow that was in c
http://stackoverflow.com/questions/212528/linux-c-get-the-ip-address-of-local-computer
Compiles on FreeBSD and the result looks sane (but on a system
Choose a different address that would not fail in a specific
situation. For example, one could read their /etc/resolve file to get
the dns server.
Brian Winfrey
~~
Important Note:
Code provide as an example. There could be errors or risks in using
it. There is no warranty implied or
2010/10/7 Luca Olivetti l...@ventoso.org
I didn't try it, but I see that it tries to connect to google's dns server,
so it'd fail miserably if the computer has no internet access.
Bye
--
Luca
I tested, without web access does not work. :o
--
Silvio Clécio,
*programmer* *ObjectPascal*
I am developing for an embedded system and found out that 'nmap --iflist'
does a faily good job of this if the output is examined and parsed properly.
If it is suitable and you can possibly extract the code (if you are prepared
to go that far) it might help you. It is also cross platform
On 7
/man-pages/online/pages/man7/netdevice.7.html
I'm sure there's some code floating around, but it probably means that
you have to translate some headers :(.
Henry
Re: [fpc-pascal] lNet getting the local IP
I found an example for linux on stack overflow that was in c
http://stackoverflow.com
-pages/online/pages/man7/netdevice.7.html
I'm sure there's some code floating around, but it probably means that
you have to translate some headers :(.
Henry
Re: [fpc-pascal] lNet getting the local IP
I found an example for linux on stack overflow that was in c
http
/online/pages/man7/netdevice.7.html
I'm sure there's some code floating around, but it probably means that
you have to translate some headers :(.
Henry
Re: [fpc-pascal] lNet getting the local IP
I found an example for linux on stack overflow that was in c
http://stackoverflow.com
I don't know if you noticed, but it appears that code has some
depracated properties that should be changed.
Here are the modifications I made in exploring this issue:
program GetPrimaryIpAddress;
{$mode objfpc}
uses
baseunix,
unixtype,
sockets,
SysUtils;
procedure Get(out AddrOut:
Am 06.10.2010 14:49, schrieb Andrew Brunner:
I just read the first line in /etc/hosts file. The first entry is the IPv4.
On Tue, Oct 5, 2010 at 3:04 PM, Felipe Monteiro de Carvalho
felipemonteiro.carva...@gmail.com wrote:
hello,
I am searching for a way to get the local IP. I already found
Ok, thanks everyone, it seams that I managed to extract a function
from Silvio's code which doesn't use Synapse. I only tested in Windows
so far:
unit chesstcputils;
{$mode objfpc}{$H+}
interface
uses
{$IFDEF MSWINDOWS}
Winsock,
{$ENDIF}
Classes, SysUtils;
function ChessGetLocalIP():
On Wed, Oct 6, 2010 at 7:55 AM, Sven Barth pascaldra...@googlemail.com wrote:
You'll only find 127.0.0.1 for my computer there... I don't think that
this is a very good solution.
Oh well. That makes sense b/c these are servers that I have obtaining
the same IP over DHCP.
On clients when DHCP
In our previous episode, Felipe Monteiro de Carvalho said:
function ChessGetLocalIP(): string;
VProcess.CommandLine :=
'sh -c ifconfig eth0 | awk ''/inet end/ {print $3}''';
Fails if eth0 is not the primary NIC. Doesn't work on non-linux (that use
other ethernet naming
On 06/10/10 14:27, Felipe Monteiro de Carvalho wrote:
Ok, thanks everyone, it seams that I managed to extract a function
from Silvio's code which doesn't use Synapse. I only tested in Windows
so far:
unit chesstcputils;
{$mode objfpc}{$H+}
interface
uses
{$IFDEF MSWINDOWS}
Winsock,
, that is a major security concern.
Jonas
--
Message: 3
Date: Wed, 6 Oct 2010 07:49:42 -0500
From: Andrew Brunner andrew.t.brun...@gmail.com
Subject: Re: [fpc-pascal] lNet getting the local IP
To: FPC-Pascal users discussions fpc-pascal@lists.freepascal.org
Message-ID
hello,
I am searching for a way to get the local IP. I already found examples
with winsock, synapse and indy. Does anyone know how to do that with
lNet?
thanks,
--
Felipe Monteiro de Carvalho
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
Hello,
Actually it uses both synapse (under unix) and winsock (under Windows).
What should one put in the parameter AHTTPSend: THTTPSend ? Where is
this type declared?
thanks,
--
Felipe Monteiro de Carvalho
___
fpc-pascal maillist -
On Mon, 2010-06-07 at 14:15 +0200, Felipe Monteiro de Carvalho wrote:
Ok, thanks, now I seam to be able to get it working using
TLTCPComponent, but I am unsure about how to read data.
Ok, I read that it will call OnReceive when there is data ready, but I
couldn't find anything about how much
I sent a direct main to Almindor and he answered my questions.
Basically there is no direct way to detect the barrier between
packages, you have to make your packet structure allow for that, but
luckly mine was already prepared for this.
And from my tests Get is indeed returning the amount read.
Am Freitag 11 Juni 2010, 18:50:56 schrieb Felipe Monteiro de Carvalho:
And from my tests Get is indeed returning the amount read. I still
don't know if half a packet could be received in the OnReceive event
or if it only returns an integer amount of packets. That makes
difference in the
Hello,
I am trying to use lNet and I have some questions.
1 Can I use TLTcp or do I need to use the visual version, TLTcpComponent?
2 Can I use only the base package or do I need to use the visual one?
Basically I am not a big fan of design time packages, I prefer to add
the units and create
You do not need to use Lazarus at all in order to develop with LNet.
You do however need the runtime package in order to work with it if you want
to use the TLTCPComponent, however if you do not want to use it, you simply
need to tell the compiler where to find LNet, and use the normal classes.
On 07/06/2010, Felipe Monteiro de Carvalho wrote:
1 Can I use TLTcp or do I need to use the visual version, TLTcpComponent?
2 Can I use only the base package or do I need to use the visual one?
Basically I am not a big fan of design time packages, I prefer to add
the units and create the
On Mon, 7 Jun 2010, Felipe Monteiro de Carvalho wrote:
Hello,
I am trying to use lNet and I have some questions.
1 Can I use TLTcp or do I need to use the visual version, TLTcpComponent?
2 Can I use only the base package or do I need to use the visual one?
Basically I am not a big fan of
Ok, thanks, now I seam to be able to get it working using
TLTCPComponent, but I am unsure about how to read data.
Ok, I read that it will call OnReceive when there is data ready, but I
couldn't find anything about how much data is waiting to be read?
I would like to get each single Packet which
76 matches
Mail list logo