[twsocket] THttpMTServer problem with Dup

2007-02-01 Thread Fastream Technologies
Hello, I have the following function called from worker thread context (NewHSocket passed with a message): function TCustomWSocketMTServer.AfterClientCreated( Client : TWSocketMTClient; Error: Word; NewHSocket: integer) : boolean; var currentClientCount: integer; currentMaxClients: i

Re: [twsocket] THttpMTServer problem with Dup

2007-02-01 Thread Arno Garrels
>Client.Dup(NewHSocket); // SOMETIMES WHEN HIGH LOAD IS IN PLACE, THIS > FUNCTION MAKES CLIENT.HSOCKET = -1 AND RAISES THE EXCEPTION "LIST ITEM OUT > OF INDEX" I don't know this exception message, do you mean "List index out of bounds()"? According to procedure Dup, the component stat

Re: [twsocket] THttpMTServer problem with Dup

2007-02-01 Thread Fastream Technologies
- Original Message - From: "Arno Garrels" <[EMAIL PROTECTED]> To: "ICS support mailing" Sent: Thursday, February 01, 2007 2:19 PM Subject: Re: [twsocket] THttpMTServer problem with Dup > >>Client.Dup(NewHSocket); // SOMETIMES WHEN HIGH LOAD IS IN PLACE, THIS >> FUNCTION MAKES CLIEN

Re: [twsocket] THttpMTServer problem with Dup

2007-02-01 Thread Arno Garrels
Fastream Technologies wrote: >> I don't know this exception message, do you mean "List index out of >> bounds()"? > > Yes, exactly. So most likely you hit a synchronization bug in your code, hard to say what's wrong. Critical stuff is access to the client list, add/remove clients and iterate. Th

Re: [twsocket] streaming video client/server application

2007-02-01 Thread Jonathan Dumaresq
> I would say before sending anything. good this is working now. thanx for your help everybody. I have another question. When I receive the data from the udp port, i have an event that is raised "OnDataAvailable". than i read the data of the udp_datagram. This is all done in a thread. I use th

Re: [twsocket] THttpMTServer problem with Dup

2007-02-01 Thread Fastream Technologies
Q: Do one need to protect Terminated variable of TThread and Terminate() as well? Best Regards, Gorkem Ates - Original Message - From: "Arno Garrels" <[EMAIL PROTECTED]> To: "ICS support mailing" Sent: Thursday, February 01, 2007 4:31 PM Subject: Re: [twsocket] THttpMTServer problem w

Re: [twsocket] THttpMTServer problem with Dup

2007-02-01 Thread Arno Garrels
Fastream Technologies wrote: > Q: Do one need to protect Terminated variable of TThread and > Terminate() as well? No, read/write of property Terminated should be atomic, so you won't get an error but a critical section may be usefull. if not Thread.Terminated then Thread.Terminate; If you d

Re: [twsocket] streaming video client/server application

2007-02-01 Thread Arno Garrels
Jonathan Dumaresq wrote: >> I would say before sending anything. > > good > > this is working now. thanx for your help everybody. > > I have another question. When I receive the data from the udp port, i > have an event that is raised "OnDataAvailable". than i read the data > of the udp_datagram

Re: [twsocket] THttpMTServer problem with Dup

2007-02-01 Thread Fastream Technologies
The exception is thrown in the function I sent. Does that mean that the unprotected buffer is in that function? Or could it be anywhere?? Best Regards, SZ - Original Message - From: "Arno Garrels" <[EMAIL PROTECTED]> To: "ICS support mailing" Sent: Thursday, February 01, 2007 6:42 PM

Re: [twsocket] streaming video client/server application

2007-02-01 Thread Arno Garrels
Arno Garrels wrote: > Jonathan Dumaresq wrote: >>> I would say before sending anything. >> >> good >> >> this is working now. thanx for your help everybody. >> >> I have another question. When I receive the data from the udp port, i >> have an event that is raised "OnDataAvailable". than i read

Re: [twsocket] streaming video client/server application

2007-02-01 Thread Wilfried Mestdagh
Hello Arno, > propably you need to pause receiving when receiving > is much faster than decoding to prevent infinite grow of your buffers. The problem is UDP. When winsock buffer is full UDP packets are trown away. Maybe no problem ? Maybe better to store on disk to not loose anything and give t

Re: [twsocket] streaming video client/server application

2007-02-01 Thread Arno Garrels
Wilfried Mestdagh wrote: > Hello Arno, > >> propably you need to pause receiving when receiving >> is much faster than decoding to prevent infinite grow of your >> buffers. > > The problem is UDP. When winsock buffer is full UDP packets are trown > away. Maybe no problem ? Ahh, missed that, so

Re: [twsocket] streaming video client/server application

2007-02-01 Thread Jonathan Dumaresq
Thanx for the postmessage thing. I will try to use sendmessage instead. >>> propably you need to pause receiving when receiving >>> is much faster than decoding to prevent infinite grow of your >>> buffers. the decoding pas is very close on my athlon xp to the time a receive udp packet. I don't