Re: [fpc-pascal] SSocket: TSocketServer.StopAccepting

2008-08-30 Thread Michael Green

Hello Hansi,

I am using Synapse for all my socket work, so this might be a bit 
different for you. But for a blocking listener in a thread (waiting at 
an Accept), I call AbortSocket. It immediately stops all work on the 
socket and lets you do the things you need to do. I'm sure there's a 
similar "Abort" function in the package you are using.


-- Mike
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Installing on Mac OS X

2008-08-30 Thread Jonas Maebe


On 30 Aug 2008, at 14:06, Paul wrote:


I have installed FPC 2.2.2 and Lazarus, both "Installed ok".
I'm shamed to say this, but I can't even find the applications.  
(first time apple user)  :-(


The FPC installation on Mac OS X does not behave in any way like that  
of a typical Mac program, but rather like that of a typical unix  
program.


The only thing I found is in folder Developer\Documentation\Free  
Pascal Compiler\ ...pdf

Did I do something wrong ?


You did not read the file "Getting Started.rtf" on the installation  
disk image, nor the "Quick start - Mac OS X/Darwin" of the file  
ReadMe.txt in the same location.



Jonas
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] FPC 2.3.1 on Mac OS X?

2008-08-30 Thread Jonas Maebe


On 30 Aug 2008, at 12:25, Paul wrote:


I've read that there are some issues with FPC 2.2.0 on Mac OSX.


There are some issues with compiling programs with FPC 2.2.0 under Mac  
OS X 10.5.x, and on all Mac OS X systems with case-sensitive file  
systems. Programs compiled with 2.2.0 under Mac OS X 10.4.x however  
work fine under Mac OS X 10.5.x.


FPC 2.2.2 resolves all those problems (but also see http://bugs.freepascal.org/view.php?id=12001 
 ).



Is it save to install version 2.3.1 already ?


It depends from which day, as it's a constantly changing version. It's  
better to use FPC 2.2.2, the latest official release.



Jonas
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] SSocket: TSocketServer.StopAccepting

2008-08-30 Thread Johann Glaser
Hi!

I'm using the SSocket unit with TSocketServer (and TInetServer) for
TCP/IP communication in a multi-threaded application. To listen (and
accept) connections from a client the method StartAccepting is called.
This is a blocking function.

To quit the server I call StopAccepting. The implementation just sets a
variable which is checked by StartAccepting.

There are two problems:
1) If using the TSocketStream in blocking mode, the accept() call used
by StartAccepting does not return at all, so StopAccepting is somewhat
useless here.
2) In non-blocking mode the internal variable is checked periodically,
but not really often, so race conditions with Destroy can happen.

In both cases, when I want to quit my program, there is no safe way to
stop accepting at the socket, except from OnConnect (as shown e.g.
in /packages/fcl-base/examples/isocksvr.pp).

So there are some ideas to solve this.

First: Send a SIGTERM to this thread, accept() will return with EINTR,
which should then be checked for in TInetServer.Accept,
TUnixServer.Accept, ... and generate a special exception which is then
again checked for in TSocketServer.StartAccepting which simply exits the
loop.

Second: Do a dummy connect to myself and check for FAccepting directly
after Accept returns and then leave the loop. I prefer this one. OTOH
this depends on knowing one's own address and allowing this connection
by the firewall rules.

In any case, I suggest that StopAccepting really waits and only returns
after StartAccepting has finished. This also must be used in Destroy.
Here we have to take care for the case if StopAccepting is called from
OnConnect.

Did I miss something? Do you have other ideas? If you agree with my
idea, I'll implement the changes and send a patch for that.

Bye
  Hansi


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] Installing on Mac OS X

2008-08-30 Thread Paul

Hi all,

I have installed FPC 2.2.2 and Lazarus, both "Installed ok".
I'm shamed to say this, but I can't even find the applications. (first time 
apple user)  :-(
The only thing I found is in folder Developer\Documentation\Free Pascal 
Compiler\ ...pdf

Did I do something wrong ?

Paul 


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] FPC 2.3.1 on Mac OS X?

2008-08-30 Thread Bee

I've read that there are some issues with FPC 2.2.0 on Mac OSX.


What issues? Is it about threading?


Is it save to install version 2.3.1 already ?


I'm using 2.3.1 on Mac OSX intel now. It was compiled using 2.2.0.

-Bee-

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] FPC 2.3.1 on Mac OS X?

2008-08-30 Thread Felipe Monteiro de Carvalho
Install 2.2.2 instead


-- 
Felipe Monteiro de Carvalho
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] FPC 2.3.1 on Mac OS X?

2008-08-30 Thread Damien Gerard


Le Aug 30, 2008 à 1:25 PM, Paul a écrit :


Hi,

I've read that there are some issues with FPC 2.2.0 on Mac OSX.
Is it save to install version 2.3.1 already ?




I use FPC from the snapshots (http://snapshots.lazarus.shikami.org/lazarus/ 
) so it is fpc 2.2.2 and it really works fine for me (it is the latest  
stable version).
The last time I checked there were still issues with generics however  
it is not something absolutely needed



--
Damien Gerard
[EMAIL PROTECTED]

Si ces robots s'humanisaient, inversement les êtres humains se  
robotiseraient-ils ?









___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] FPC 2.3.1 on Mac OS X?

2008-08-30 Thread Paul

Hi,

I've read that there are some issues with FPC 2.2.0 on Mac OSX.
Is it save to install version 2.3.1 already ?

Paul
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Mac OS X api cals

2008-08-30 Thread Jonas Maebe


On 30 Aug 2008, at 10:24, Paul wrote:


Wow, exactly the things I need.
I remember that there is a tool available to convert C-headers to  
pascal (I'm not a great C-fan)

Anyone knows what it is ?


Most of these API's are already available in a unit called MacOSAll  
which is shipped with FPC. The tool you want is called h2pas, but note  
that it will still require manual intervention afterwards.



Jonas
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Mac OS X api cals

2008-08-30 Thread Paul


Wow, exactly the things I need.
I remember that there is a tool available to convert C-headers to pascal 
(I'm not a great C-fan)

Anyone knows what it is ?
(Sorry for asking all this questions, but I've been thinking to use FPC for 
a long time, but never came to do it.

I've been reading the messages on list for a while though.
I need to install it on the Mac first, so probably, I'll be asking some more 
for the installation...)


thanks,

Paul



- Original Message - 
From: "Damien Gerard" <[EMAIL PROTECTED]>

To: "FPC-Pascal users discussions" 
Sent: Friday, August 29, 2008 11:18 PM
Subject: Re: [fpc-pascal] Mac OS X api cals



Le Aug 29, 2008 à 10:55 PM, Damien Gerard a écrit :



Le Aug 28, 2008 à 10:55 PM, Paul a écrit :

However, as a bank, they only trust on themselves. And they like  to 
reinvent a broken wheel :)


exactly :-)

they also like many custom features ..



Just in case you really really want to remake the world, here is a  link 
which may help you :
http://developer.apple.com/documentation/GraphicsImaging/Conceptual/QuartzDisplayServicesConceptual/Articles/MouseCursor.html#/ 
/apple_ref/doc/uid/TP40004269


http://developer.apple.com/documentation/GraphicsImaging/Reference/Quartz_Services_Ref/Reference/reference.html#/
/apple_ref/c/func/CGDisplayModelNumber


--
Damien Gerard
[EMAIL PROTECTED]

Si ces robots s'humanisaient, inversement les êtres humains se
robotiseraient-ils ?








___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Mac OSX API call

2008-08-30 Thread Jonas Maebe


On 29 Aug 2008, at 20:34, Jonas Maebe wrote:



On 29 Aug 2008, at 11:58, EarMaster - Bent Olsen wrote:


From: [EMAIL PROTECTED] [mailto:fpc-pascal-
[EMAIL PROTECTED] On Behalf Of Vincent Snijders
Sent: 29. august 2008 12:27
To: FPC-Pascal users discussions
Subject: Re: [fpc-pascal] Mac OSX API call

I think it should be (no var for the pointer):


I tried, and same result.

Could a Mac OSX API call return -50 even though the types are  
correct, but

the contents of them are not what it expected?

I would assume -50 is only after a check for types in the parameter  
list,

and check is done before even calling the API.


External functions have no idea what the declaration of the function  
in your source code is. A couple of the parameters your are passing  
(inAudioFile a outPacketDescriptions) however are pointers to opaque  
structures, and the called function is probably performing some  
sanity checks on those structures to ensure that they are valid.


Or alternatively, one of the other parameters could be invalid as well  
(either on their own or in combination with the other parame

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal