Re: [fpc-pascal] Re: Odyssey: SSockets and Threads.

2013-04-29 Thread Reinier Olislagers
On 29-4-2013 14:10, Lukasz Sokol wrote: On 29/04/2013 11:04, Reinier Olislagers wrote: On 29-4-2013 11:50, Lukasz Sokol wrote: On 27/04/2013 16:06, silvioprog wrote: 2013/4/27 Sven Barth pascaldragon-gM/ye1e23mwn+bqq9rb...@public.gmane.org

Re: [fpc-pascal] Re: Odyssey: SSockets and Threads.

2013-04-29 Thread Jonas Maebe
On 29 Apr 2013, at 14:12, Reinier Olislagers wrote: I understand, but the problematic part was an upload to a third party site which has been deleted long since. So even browsing gmane/other archives, there's nothing left to see... He also posted one of the Delphi functions to the list

Re: [fpc-pascal] Re: Odyssey: SSockets and Threads.

2013-04-29 Thread Reinier Olislagers
On 29-4-2013 14:41, Jonas Maebe wrote: On 29 Apr 2013, at 14:12, Reinier Olislagers wrote: I understand, but the problematic part was an upload to a third party site which has been deleted long since. So even browsing gmane/other archives, there's nothing left to see... He also posted

Re: [fpc-pascal] Re: Odyssey: SSockets and Threads.

2013-04-29 Thread waldo kitty
On 4/29/2013 06:04, Reinier Olislagers wrote: On 29-4-2013 11:50, Lukasz Sokol wrote: On 27/04/2013 16:06, silvioprog wrote: 2013/4/27 Sven Barthpascaldragon-gM/ye1e23mwn+bqq9rb...@public.gmane.org mailto:pascaldragon-gM/ye1e23mwn+bqq9rb...@public.gmane.org On 26.04.2013 21:38, silvioprog

Re: [fpc-pascal] Re: Odyssey: SSockets and Threads.

2013-04-29 Thread silvioprog
2013/4/29 Jonas Maebe jonas.ma...@elis.ugent.be On 29 Apr 2013, at 14:12, Reinier Olislagers wrote: I understand, but the problematic part was an upload to a third party site which has been deleted long since. So even browsing gmane/other archives, there's nothing left to see... He also

Re: [fpc-pascal] Re: Odyssey: SSockets and Threads.

2013-04-29 Thread waldo kitty
On 4/29/2013 13:29, silvioprog wrote: Well, I messed up badly, sorry again. I don't know if that would solve the problem, but if they prefer, we can delete me from the FPC lists, because I have no intention to piracy. Will be discretion of yours guys. x( speaking only for myself: i think you

Re: [fpc-pascal] Re: Odyssey: SSockets and Threads.

2013-04-29 Thread Jonas Maebe
On 29 Apr 2013, at 19:29, silvioprog wrote: I don't know if that would solve the problem, but if they prefer, we can delete me from the FPC lists, because I have no intention to piracy. I know you don't, and there's definitely no way you will be removed from the list because you simply made

Re: [fpc-pascal] Re: Odyssey: SSockets and Threads.

2013-04-27 Thread Sven Barth
On 26.04.2013 21:38, silvioprog wrote: Select in socket of Delphi 2007 (a friend sent it to me: http://www.sendspace.com/file/06ev02): Gaahhh!!! Don't simply send Delphi code to this list! Did you ever heard of stuff like clean room reverse engineeering?! Regards, Sven

Re: [fpc-pascal] Re: Odyssey: SSockets and Threads.

2013-04-27 Thread silvioprog
2013/4/27 Sven Barth pascaldra...@googlemail.com On 26.04.2013 21:38, silvioprog wrote: Select in socket of Delphi 2007 (a friend sent it to me: http://www.sendspace.com/file/**06ev02http://www.sendspace.com/file/06ev02 ): Gaahhh!!! Don't simply send Delphi code to this list! Did you ever

Re: [fpc-pascal] Re: Odyssey: SSockets and Threads.

2013-04-27 Thread waldo kitty
On 4/27/2013 11:06, silvioprog wrote: 2013/4/27 Sven Barth pascaldra...@googlemail.com mailto:pascaldra...@googlemail.com On 26.04.2013 21:38, silvioprog wrote: Select in socket of Delphi 2007 (a friend sent it to me: http://www.sendspace.com/file/__06ev02: Gaahhh!!!

Re: [fpc-pascal] Re: Odyssey: SSockets and Threads.

2013-04-27 Thread silvioprog
2013/4/27 waldo kitty wkitt...@windstream.net On 4/27/2013 11:06, silvioprog wrote: 2013/4/27 Sven Barth pascaldra...@googlemail.com mailto:pascaldragon@**googlemail.com pascaldra...@googlemail.com On 26.04.2013 21:38, silvioprog wrote: Select in socket of Delphi 2007 (a

Re: [fpc-pascal] Re: Odyssey: SSockets and Threads.

2013-04-27 Thread waldo kitty
On 4/27/2013 13:51, silvioprog wrote: 2013/4/27 waldo kitty wkitt...@windstream.net mailto:wkitt...@windstream.net On 4/27/2013 11:06, silvioprog wrote: 2013/4/27 Sven Barth pascaldra...@googlemail.com On 26.04.2013 21:38, silvioprog wrote: Select in

Re: [fpc-pascal] Re: Odyssey: SSockets and Threads.

2013-04-26 Thread Michael Van Canneyt
On Thu, 25 Apr 2013, silvioprog wrote: 2013/4/25 Michael Van Canneyt mich...@freepascal.org [...] Well, ssockets is very low level. fpselect() is mostly useful when you combine multiple file descriptors at once. Although it can be done, IMHO it makes little sense to create a select()

Re: [fpc-pascal] Re: Odyssey: SSockets and Threads.

2013-04-26 Thread Ludo Brands
On 04/26/2013 08:58 AM, Michael Van Canneyt wrote: On Thu, 25 Apr 2013, silvioprog wrote: I do not know where it would be used, it's just an observation hehe... Yes, but the above is what I mean with 'it does not make much sense'. I can easily add this - in fact I will do so, but

Re: [fpc-pascal] Re: Odyssey: SSockets and Threads.

2013-04-26 Thread Michael Van Canneyt
On Fri, 26 Apr 2013, Ludo Brands wrote: On 04/26/2013 08:58 AM, Michael Van Canneyt wrote: On Thu, 25 Apr 2013, silvioprog wrote: I do not know where it would be used, it's just an observation hehe... Yes, but the above is what I mean with 'it does not make much sense'. I can easily

Re: [fpc-pascal] Re: Odyssey: SSockets and Threads.

2013-04-26 Thread Marco van de Voort
In our previous episode, Michael Van Canneyt said: when the socket buffer is not empty. Note that select also returns when an exception occurs. I am aware of all this. My only 'objection' is that waitfordata() will operate on a single socket only. Good for single client, bad for

Re: [fpc-pascal] Re: Odyssey: SSockets and Threads.

2013-04-26 Thread Ludo Brands
On 04/26/2013 09:19 AM, Michael Van Canneyt wrote: On Fri, 26 Apr 2013, Ludo Brands wrote: On 04/26/2013 08:58 AM, Michael Van Canneyt wrote: On Thu, 25 Apr 2013, silvioprog wrote: I do not know where it would be used, it's just an observation hehe... Yes, but the above is what I

Re: [fpc-pascal] Re: Odyssey: SSockets and Threads.

2013-04-26 Thread Michael Van Canneyt
On Fri, 26 Apr 2013, Marco van de Voort wrote: In our previous episode, Michael Van Canneyt said: when the socket buffer is not empty. Note that select also returns when an exception occurs. I am aware of all this. My only 'objection' is that waitfordata() will operate on a single socket

Re: [fpc-pascal] Re: Odyssey: SSockets and Threads.

2013-04-26 Thread Marco van de Voort
In our previous episode, Michael Van Canneyt said: I am aware of all this. My only 'objection' is that waitfordata() will operate on a single socket only. Good for single client, bad for server. How many open sockets must you have to qualify as a server? Well, you can't get more

Re: [fpc-pascal] Re: Odyssey: SSockets and Threads.

2013-04-26 Thread silvioprog
2013/4/26 Ludo Brands ludo.bra...@free.fr On 04/26/2013 08:58 AM, Michael Van Canneyt wrote: On Thu, 25 Apr 2013, silvioprog wrote: I do not know where it would be used, it's just an observation hehe... Yes, but the above is what I mean with 'it does not make much sense'. I can

Re: [fpc-pascal] Re: Odyssey: SSockets and Threads.

2013-04-26 Thread silvioprog
2013/4/26 Michael Schnell mschn...@lumino.de On 04/25/2013 06:15 PM, silvioprog wrote: Yes, OnDisconnect, it works exactly as you explained. But I also have the OnError event, which is useful when the client is terminated by an error (eg. killing the client via Ctrl+Alt+Del). :) It might

Re: [fpc-pascal] Re: Odyssey: SSockets and Threads.

2013-04-26 Thread silvioprog
2013/4/26 Ludo Brands ludo.bra...@free.fr On 04/26/2013 09:19 AM, Michael Van Canneyt wrote: On Fri, 26 Apr 2013, Ludo Brands wrote: On 04/26/2013 08:58 AM, Michael Van Canneyt wrote: On Thu, 25 Apr 2013, silvioprog wrote: I do not know where it would be used, it's just an

Re: [fpc-pascal] Re: Odyssey: SSockets and Threads.

2013-04-26 Thread Ludo Brands
On 04/26/2013 07:06 PM, silvioprog wrote: Ludo, a small question So, In loop of my thread, to the process doesn't stay blocked in recv, I need to use select in client too? If your socket is in blocking mode and you don't want your thread to block, yes. Server or client, there is no

Re: [fpc-pascal] Re: Odyssey: SSockets and Threads.

2013-04-26 Thread silvioprog
Select in socket of Delphi 2007 (a friend sent it to me: http://www.sendspace.com/file/06ev02): function TBaseSocket.Select(ReadReady, WriteReady, ExceptFlag: PBoolean; TimeOut: Integer): Boolean; var ReadFds: TFDset; ReadFdsptr: PFDset; WriteFds: TFDset; WriteFdsptr: PFDset; ExceptFds:

Re: [fpc-pascal] Re: Odyssey: SSockets and Threads.

2013-04-25 Thread Ludo Brands
On 04/24/2013 10:21 PM, silvioprog wrote: 2013/4/24 silvioprog silviop...@gmail.com mailto:silviop...@gmail.com Hello, There are a multi-thread example using SSockets in FPC? I'm trying to implement it*, but it's very hard and this work it's consuming all my time. The

Re: [fpc-pascal] Re: Odyssey: SSockets and Threads.

2013-04-25 Thread Michael Van Canneyt
On Wed, 24 Apr 2013, silvioprog wrote: 2013/4/24 silvioprog silviop...@gmail.com Hello, There are a multi-thread example using SSockets in FPC? I'm trying to implement it*, but it's very hard and this work it's consuming all my time. The difficulty is to read and write at the same

Re: [fpc-pascal] Re: Odyssey: SSockets and Threads.

2013-04-25 Thread Michael Schnell
On 04/24/2013 10:21 PM, silvioprog wrote: (no Synapse, LNet or Indy please, I need to use native code) Indy does provide support for threading (as does AsyncPro, the Socket flavor of which could be of interest here). But I don't know if it's easy to use Indy with Lazarus, and I know that

Re: [fpc-pascal] Re: Odyssey: SSockets and Threads.

2013-04-25 Thread silvioprog
2013/4/25 Ludo Brands ludo.bra...@free.fr [...] what is the problem with using Synapse, LNet or Indy? Seen the questions you are asking I would suggest you use an existing library and stay away from writing your own socket library or start with learning the basics of socket programming.

Re: [fpc-pascal] Re: Odyssey: SSockets and Threads.

2013-04-25 Thread silvioprog
2013/4/25 Michael Van Canneyt mich...@freepascal.org Why is that ? Please define read and write at the same time first. Sorry, my English is bad. ^^ So, a small example (pseudo code): procedure TMyThread1.Execute; begin while not Terminated do begin GlobalSocket.Write ... end;

Re: [fpc-pascal] Re: Odyssey: SSockets and Threads.

2013-04-25 Thread silvioprog
2013/4/25 silvioprog silviop...@gmail.com [...] Yes, I love Synapse, but it is not distributed with Free Pascal. I think the Free Pascal need to distribute something like SktComp( http://pastebin.com/QBZU89cy) of Delphi. SSockets is not multi-threaded. ... and I'm trying to por SktComp to

Re: [fpc-pascal] Re: Odyssey: SSockets and Threads.

2013-04-25 Thread silvioprog
2013/4/25 Michael Schnell mschn...@lumino.de On 04/24/2013 10:21 PM, silvioprog wrote: (no Synapse, LNet or Indy please, I need to use native code) Indy does provide support for threading (as does AsyncPro, the Socket flavor of which could be of interest here). But I don't know if it's

Re: [fpc-pascal] Re: Odyssey: SSockets and Threads.

2013-04-25 Thread Michael Schnell
On 04/25/2013 05:15 PM, silvioprog wrote: Indy has a feature (OnDisconnect property) that notifies you when a client is not online. Nope. It notifies you when the other site actively and successfully does a disconnect and your site correctly understands the notification. Not correctly

Re: [fpc-pascal] Re: Odyssey: SSockets and Threads.

2013-04-25 Thread silvioprog
2013/4/25 Michael Schnell mschn...@lumino.de On 04/25/2013 05:15 PM, silvioprog wrote: Indy has a feature (OnDisconnect property) that notifies you when a client is not online. Nope. It notifies you when the other site actively and successfully does a disconnect and your site

Re: [fpc-pascal] Re: Odyssey: SSockets and Threads.

2013-04-25 Thread Paul Breneman
silvioprog wrote: 2013/4/25 Michael Schnell mschn...@lumino.de On 04/25/2013 05:15 PM, silvioprog wrote: Indy has a feature (OnDisconnect property) that notifies you when a client is not online. Nope. It notifies you when the other site actively and successfully does a disconnect and

Re: [fpc-pascal] Re: Odyssey: SSockets and Threads.

2013-04-25 Thread silvioprog
2013/4/25 Paul Breneman paul2...@brenemanlabs.com silvioprog wrote: 2013/4/25 Michael Schnell mschn...@lumino.de On 04/25/2013 05:15 PM, silvioprog wrote: Indy has a feature (OnDisconnect property) that notifies you when a client is not online. Nope. It notifies you when the other

Re: [fpc-pascal] Re: Odyssey: SSockets and Threads.

2013-04-25 Thread silvioprog
Very nice article: http://www.bastisoft.de/programmierung/pascal/pasinet.html Outdated, but very very nice. :) -- Silvio Clécio My public projects - github.com/silvioprog ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org

Re: [fpc-pascal] Re: Odyssey: SSockets and Threads.

2013-04-25 Thread silvioprog
2013/4/25 silvioprog silviop...@gmail.com Very nice article: http://www.bastisoft.de/programmierung/pascal/pasinet.html Outdated, but very very nice. :) in...: repeat put all sockets currently connected in the read set; put the listening socket in the read set; Select(read set,

Re: [fpc-pascal] Re: Odyssey: SSockets and Threads.

2013-04-25 Thread Michael Van Canneyt
On Thu, 25 Apr 2013, silvioprog wrote: 2013/4/25 silvioprog silviop...@gmail.com Very nice article: http://www.bastisoft.de/programmierung/pascal/pasinet.html Outdated, but very very nice. :) in...: repeat put all sockets currently connected in the read set; put the listening

Re: [fpc-pascal] Re: Odyssey: SSockets and Threads.

2013-04-25 Thread silvioprog
2013/4/25 Michael Van Canneyt mich...@freepascal.org [...] Well, ssockets is very low level. fpselect() is mostly useful when you combine multiple file descriptors at once. Although it can be done, IMHO it makes little sense to create a select() method on the socket stream, since it would