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

2013-04-30 Thread Lukasz Sokol
On 29/04/2013 17:58, waldo kitty wrote: > 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 Barth>>> > On 26.04.20

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-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 h

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

2013-04-29 Thread silvioprog
2013/4/29 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

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 Barthmailto:pascaldragon-gM/ye1e23mwn+bqq9rb...@public.gmane.org>> On 26.04.2013 21:38, silvioprog wrote: Oopppss, sorry. I'll delete it. :X Too

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 als

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 itself

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 >>> > On 26.04.2013 21:38,

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

2013-04-29 Thread Lukasz Sokol
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 >> > >>> >>> On 26.04.2013 21:38, silvioprog wrote: >>> Oopppss, sorry. I'

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

2013-04-29 Thread Reinier Olislagers
On 29-4-2013 11:50, Lukasz Sokol wrote: > On 27/04/2013 16:06, silvioprog wrote: >> 2013/4/27 Sven Barth > > >> >> On 26.04.2013 21:38, silvioprog wrote: >> Oopppss, sorry. I'll delete it. :X >> > Too late, gmane mail to news alre

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

2013-04-29 Thread Lukasz Sokol
On 27/04/2013 16:06, silvioprog wrote: > 2013/4/27 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 > ): > > >

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 mailto:wkitt...@windstream.net>> On 4/27/2013 11:06, silvioprog wrote: 2013/4/27 Sven Barth On 26.04.2013 21:38, silvioprog wrote: Select in socket of Delphi 2007 (a friend sent it to me:

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

2013-04-27 Thread silvioprog
2013/4/27 waldo kitty > On 4/27/2013 11:06, silvioprog wrote: > >> 2013/4/27 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/fil

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 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!!! Don't simply send Delphi cod

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

2013-04-27 Thread silvioprog
2013/4/27 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 st

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-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-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 n

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

2013-04-26 Thread silvioprog
2013/4/26 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

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

2013-04-26 Thread silvioprog
2013/4/26 Michael Schnell > 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 be able

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

2013-04-26 Thread silvioprog
2013/4/26 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

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: 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

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

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 on

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,

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 fo

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

2013-04-26 Thread Michael Schnell
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 be able to detect a certain kind of errors. Nonet

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 ad

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

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 Michael Van Canneyt [...] 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 s

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

2013-04-25 Thread silvioprog
2013/4/25 Michael Van Canneyt > [...] > 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 only have one sock

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 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 s

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

2013-04-25 Thread silvioprog
2013/4/25 silvioprog > 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, no other sets,

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 http://lists.freepas

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

2013-04-25 Thread silvioprog
2013/4/25 Paul Breneman > silvioprog wrote: > >> 2013/4/25 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 act

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

2013-04-25 Thread Paul Breneman
silvioprog wrote: 2013/4/25 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 un

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

2013-04-25 Thread silvioprog
2013/4/25 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

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 com

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

2013-04-25 Thread silvioprog
2013/4/25 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 us

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

2013-04-25 Thread silvioprog
2013/4/25 silvioprog > [...] > 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 Free Pascal, but

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

2013-04-25 Thread silvioprog
2013/4/25 Michael Van Canneyt > 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; end; procedure TMyT

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

2013-04-25 Thread silvioprog
2013/4/25 Ludo Brands > [...] > 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. > There no problem

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 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 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 time. I'm almost certa

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

2013-04-24 Thread Ludo Brands
On 04/24/2013 10:21 PM, silvioprog wrote: > 2013/4/24 silvioprog 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 difficulty is

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

2013-04-24 Thread silvioprog
2013/4/24 silvioprog > 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 > time. I'm almost certain that using SSockets, I would have to