Re: [twsocket] ICS help system?

2006-02-09 Thread Tibor Csonka

>I much prefer it were hosted directly at OverByte, but just in case, 
>know that the hosting space I have available includes MySQL/PHP and all 
>the standard features.  I always intended to make a web site, but never 
>found the time, so I have 10GB of space, which I pay for yearly, just 
>wasting away.
>  
>
I know the feeling ;)
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] [QUESTION] ThttpServer and threading design

2006-02-09 Thread Guillaume MAISON
Francois Piette a écrit :
> 
> That's what I do with my MidWare threaded TServerObject. You can apply the 
> same logic to the
> HttpServer component.
> 
> I have a class which manage a pool of threads. When a request comes in, I get 
> a thread from the
> pool, adding a new one if necessary. The thread receive a reference to the 
> socket component , this
> is important. The thread execute the lengthy database request and build the 
> response message and
> pass it to the main thread for sending it back to the client.
> 
> When the socket detect a session close, then it nullify the reference the 
> thread has so that the
> thread know it has to throw away any data or pass it back to the main thread.

that's what i'll almost implement.

BTW, i think that, if the ICS Wiki project is realized, there should be a 
category that should present some design pattern to 
use with ICS components.

May be i could help to write some of those articles :)

Even, to explain the design patterns that are used internally by ICS :)

Thanks for your help,

Regards,

-- 

Guillaume MAISON - [EMAIL PROTECTED]
83, Cours Victor Hugo
47000 AGEN
Tél : 05 53 87 91 48 - Fax : 05 53 68 73 50
e-mail : [EMAIL PROTECTED] - Web : http://nauteus.com

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] ICS help system?

2006-02-09 Thread DZ-Jay
Fredrik Larsson wrote:
> Just MySQL and PHP. And probably the best place for a ICS/Midware wiki is
> with you (Francois) :)


I much prefer it were hosted directly at OverByte, but just in case, 
know that the hosting space I have available includes MySQL/PHP and all 
the standard features.  I always intended to make a web site, but never 
found the time, so I have 10GB of space, which I pay for yearly, just 
wasting away.

dZ.
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] [QUESTION] ThttpServer and threading design

2006-02-09 Thread Francois Piette
> back  data  to  wrong  client.  That  is why I know use an incremental
> SessionID  counter that I pass to worker to be sure to never send data
> back  to  wrong  socket  and  be  sure  to  always get unique ID among
> thousand of connections.

That's good. You can use the reference to find out if it is still in the 
clients list and if yes,
check the unique ID to see if it is still the same (a component may be freed 
and the exact same
address allocated to a new one. This one will of course have a new ID).

--
Contribute to the SSL Effort. Visit
http://www.overbyte.be/eng/ssl.html
--
[EMAIL PROTECTED]
Author of ICS (Internet Component Suite, freeware)
Author of MidWare (Multi-tier framework, freeware)
http://www.overbyte.be



- Original Message - 
From: "Dod" <[EMAIL PROTECTED]>
To: "ICS support mailing" 
Sent: Thursday, February 09, 2006 2:37 PM
Subject: Re: [twsocket] [QUESTION] ThttpServer and threading design


> Hello Francois,
>
> Exactly  what  I do now, but what reference do you pass to thread ? At
> beginning  I  did  it with socket.handle (if I remember well by it was
> long  time  ago)  by  I  noticed that if during work job the socket is
> closed  and  a new connexion come, then it could happend that this new
> socket  get  same  handle as previous closed one so my worker may sent
> back  data  to  wrong  client.  That  is why I know use an incremental
> SessionID  counter that I pass to worker to be sure to never send data
> back  to  wrong  socket  and  be  sure  to  always get unique ID among
> thousand of connections.
>
> FP> That's what I do with my MidWare threaded TServerObject. You can apply 
> the same logic to the
> FP> HttpServer component.
>
> FP> I have a class which manage a pool of threads. When a request comes in, I 
> get a thread from
the
> FP> pool, adding a new one if necessary. The thread receive a reference to 
> the socket component ,
this
> FP> is important. The thread execute the lengthy database request and build 
> the response message
and
> FP> pass it to the main thread for sending it back to the client.
>
> FP> When the socket detect a session close, then it nullify the reference the 
> thread has so that
the
> FP> thread know it has to throw away any data or pass it back to the main 
> thread.
>
> FP> --
> FP> Contribute to the SSL Effort. Visit
> FP> http://www.overbyte.be/eng/ssl.html
> FP> --
> FP> [EMAIL PROTECTED]
> FP> Author of ICS (Internet Component Suite, freeware)
> FP> Author of MidWare (Multi-tier framework, freeware)
> FP> http://www.overbyte.be
>
> -- 
> To unsubscribe or change your settings for TWSocket mailing list
> please goto http://www.elists.org/mailman/listinfo/twsocket
> Visit our website at http://www.overbyte.be

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] [QUESTION] ThttpServer and threading design

2006-02-09 Thread Dod
Hello Francois,

Exactly  what  I do now, but what reference do you pass to thread ? At
beginning  I  did  it with socket.handle (if I remember well by it was
long  time  ago)  by  I  noticed that if during work job the socket is
closed  and  a new connexion come, then it could happend that this new
socket  get  same  handle as previous closed one so my worker may sent
back  data  to  wrong  client.  That  is why I know use an incremental
SessionID  counter that I pass to worker to be sure to never send data
back  to  wrong  socket  and  be  sure  to  always get unique ID among
thousand of connections.

FP> That's what I do with my MidWare threaded TServerObject. You can apply the 
same logic to the
FP> HttpServer component.

FP> I have a class which manage a pool of threads. When a request comes in, I 
get a thread from the
FP> pool, adding a new one if necessary. The thread receive a reference to the 
socket component , this
FP> is important. The thread execute the lengthy database request and build the 
response message and
FP> pass it to the main thread for sending it back to the client.

FP> When the socket detect a session close, then it nullify the reference the 
thread has so that the
FP> thread know it has to throw away any data or pass it back to the main 
thread.

FP> --
FP> Contribute to the SSL Effort. Visit
FP> http://www.overbyte.be/eng/ssl.html
FP> --
FP> [EMAIL PROTECTED]
FP> Author of ICS (Internet Component Suite, freeware)
FP> Author of MidWare (Multi-tier framework, freeware)
FP> http://www.overbyte.be

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] about the socket close

2006-02-09 Thread Francois Piette
> > To send a FIN to the remote site, you have to call Shutdown, not Close.
> > When the remote acknoledge
> > the end of connection, you get the OnSessionClosed event triggered.

> Thanks for Francois.Following your words,when the server don't call the
> 'shutdown()',does it mean that the second FIN can't be sent to client,even
> if it has received the client's FIN?

Either party (client or server) can call Shutdown to gracefully terminate the 
connection. Winsock
does the sequence you described and both parties receive the OnSessionClosed 
event.

--
Contribute to the SSL Effort. Visit
http://www.overbyte.be/eng/ssl.html
--
[EMAIL PROTECTED]
Author of ICS (Internet Component Suite, freeware)
Author of MidWare (Multi-tier framework, freeware)
http://www.overbyte.be


-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] about the socket close

2006-02-09 Thread Jeff Peng
Sorry for having sent the same message to this list two times.

Thanks for Francois.Following your words,when the server don't call the
'shutdown()',does it mean that the second FIN can't be sent to client,even
if it has received the client's FIN?


2006/2/9, Francois Piette <[EMAIL PROTECTED]>:
>
> I'm not sure I understand...
> To send a FIN to the remote site, you have to call Shutdown, not Close.
> When the remote acknoledge
> the end of connection, you get the OnSessionClosed event triggered.
>
> --
> Contribute to the SSL Effort. Visit
> http://www.overbyte.be/eng/ssl.html
> --
> [EMAIL PROTECTED]
> Author of ICS (Internet Component Suite, freeware)
> Author of MidWare (Multi-tier framework, freeware)
> http://www.overbyte.be
>
>
>
> - Original Message -
> From: "Jeff Peng" <[EMAIL PROTECTED]>
> To: 
> Sent: Thursday, February 09, 2006 11:44 AM
> Subject: [twsocket] about the socket close
>
>
> > hello,list,
> >
> > I have a pair of Client-Server Socket programs.When the client have
> finished
> > writing the datas,it should call the 'close()' to close the socket-end
> for
> > client.And,when the server receive the EOF coming from client,it should
> call
> > the 'close()' the close socket-end for server.Then the established
> socket
> > between client and server should be freed.
> >
> > As we know,the close behavier under tcp socket is shown as below:
> >
> >  *  Client   --->  FIN  --->  Server*
> >
> > *   Client   <---  ACK  <---  Server*
> >
> > *   Client   <---  FIN  <---  Server*
> >
> >*Server   --->  ACK  --->  Client*
> >
> > **
> >
> > *The question I want to know is,when the 'close()' call happened,if it
> > should generate a 'FIN' and send it to another end?If it's true,then at
> the
> > server end,when it receive the 'EOF' coming from client,it can delay for
> > some time to call 'close()',so the 'FIN' should not be sent to client
> > immediately,is it?*
> >
> > *Thanks for replies.*
> >
> > **
> >
> > **
> >
> > *Jeff*
> > --
> > To unsubscribe or change your settings for TWSocket mailing list
> > please goto http://www.elists.org/mailman/listinfo/twsocket
> > Visit our website at http://www.overbyte.be
>
> --
> To unsubscribe or change your settings for TWSocket mailing list
> please goto http://www.elists.org/mailman/listinfo/twsocket
> Visit our website at http://www.overbyte.be
>
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] ICS help system?

2006-02-09 Thread Fredrik Larsson
Just MySQL and PHP. And probably the best place for a ICS/Midware wiki is
with you (Francois) :)

Regards, Fredrik. 

> -Original Message-
> > I have this hosted site that it is currently not being used for 
> > *anything*.  I will be glad to donate some (most?) of this space to 
> > host the ICS wiki if you guys want.
> 
> I have some space available on my website.
> What are the requirements ?

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] [QUESTION] ThttpServer and threading design

2006-02-09 Thread Francois Piette
> What you're doing is transfering a socket from main thread
> context to your work thread context.
> My purpose is not the following. What i mean is executing
> all the SQL stuff within the thread,
> and the connection stuff within the main thread.

That's what I do with my MidWare threaded TServerObject. You can apply the same 
logic to the
HttpServer component.

I have a class which manage a pool of threads. When a request comes in, I get a 
thread from the
pool, adding a new one if necessary. The thread receive a reference to the 
socket component , this
is important. The thread execute the lengthy database request and build the 
response message and
pass it to the main thread for sending it back to the client.

When the socket detect a session close, then it nullify the reference the 
thread has so that the
thread know it has to throw away any data or pass it back to the main thread.

--
Contribute to the SSL Effort. Visit
http://www.overbyte.be/eng/ssl.html
--
[EMAIL PROTECTED]
Author of ICS (Internet Component Suite, freeware)
Author of MidWare (Multi-tier framework, freeware)
http://www.overbyte.be



-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] about the socket close

2006-02-09 Thread Francois Piette
I'm not sure I understand...
To send a FIN to the remote site, you have to call Shutdown, not Close. When 
the remote acknoledge
the end of connection, you get the OnSessionClosed event triggered.

--
Contribute to the SSL Effort. Visit
http://www.overbyte.be/eng/ssl.html
--
[EMAIL PROTECTED]
Author of ICS (Internet Component Suite, freeware)
Author of MidWare (Multi-tier framework, freeware)
http://www.overbyte.be



- Original Message - 
From: "Jeff Peng" <[EMAIL PROTECTED]>
To: 
Sent: Thursday, February 09, 2006 11:44 AM
Subject: [twsocket] about the socket close


> hello,list,
>
> I have a pair of Client-Server Socket programs.When the client have finished
> writing the datas,it should call the 'close()' to close the socket-end for
> client.And,when the server receive the EOF coming from client,it should call
> the 'close()' the close socket-end for server.Then the established socket
> between client and server should be freed.
>
> As we know,the close behavier under tcp socket is shown as below:
>
>  *  Client   --->  FIN  --->  Server*
>
> *   Client   <---  ACK  <---  Server*
>
> *   Client   <---  FIN  <---  Server*
>
>*Server   --->  ACK  --->  Client*
>
> **
>
> *The question I want to know is,when the 'close()' call happened,if it
> should generate a 'FIN' and send it to another end?If it's true,then at the
> server end,when it receive the 'EOF' coming from client,it can delay for
> some time to call 'close()',so the 'FIN' should not be sent to client
> immediately,is it?*
>
> *Thanks for replies.*
>
> **
>
> **
>
> *Jeff*
> -- 
> To unsubscribe or change your settings for TWSocket mailing list
> please goto http://www.elists.org/mailman/listinfo/twsocket
> Visit our website at http://www.overbyte.be

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] ICS help system?

2006-02-09 Thread Francois Piette
> I have this hosted site that it is currently not being used for 
> *anything*.  I will be glad to donate some (most?) of this space to 
> host the ICS wiki if you guys want.

I have some space available on my website.
What are the requirements ?

--
[EMAIL PROTECTED]
http://www.overbyte.be

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] [QUESTION] ThttpServer and threading design

2006-02-09 Thread Guillaume MAISON
Dod a écrit :
> Ok  so  you  do  nearly  same  as me. But at the end of threaded job I
> verify the client still exists before sending result.
> 
> When  a  session  connect  I  set  a  SessionID incremental counter in
> MySocketClient  class because I noticed that same socket handle can be
> re-used by a next connection.
> 
> So  when  I  finish the job I just check if SessionID is still part of
> actual session's list.
> 
> But  setting  a  'killed'  value in working thread is also good.
> 

Yes.

In fact, the more i work on the overall design, the more it looks like 
midware's one :)
Except that i can't use midware ! Damn !

Thanks for your help !

Best regards,

-- 

Guillaume MAISON - [EMAIL PROTECTED]
83, Cours Victor Hugo
47000 AGEN
Tél : 05 53 87 91 48 - Fax : 05 53 68 73 50
e-mail : [EMAIL PROTECTED] - Web : http://nauteus.com

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] [QUESTION] ThttpServer and threading design

2006-02-09 Thread Dod
Hello Guillaume,

Ok  so  you  do  nearly  same  as me. But at the end of threaded job I
verify the client still exists before sending result.

When  a  session  connect  I  set  a  SessionID incremental counter in
MySocketClient  class because I noticed that same socket handle can be
re-used by a next connection.

So  when  I  finish the job I just check if SessionID is still part of
actual session's list.

But  setting  a  'killed'  value in working thread is also good.

GM> Dod a écrit :
>> Hello Guillaume,
>> 
>> Until know what I use to do is to create a worker thread and send jobs
>> (with  pointer  to  socket  client object) and then worker send back a
>> message  to socket thread with pointer of data to send back to client.
>> So all socket things is done from same thread.
>> Dettaching  clientsocket  from  socket thread to attach it into worker
>> thread when starting lenghty operation is something I never did.

GM> What you're doing is transfering a socket from main thread context to your 
work thread context.
GM> My purpose is not the following. What i mean is executing all the SQL stuff 
within the thread,
GM> and the connection stuff within the main thread. When i meant "attaching 
the socket" it was not using the MultiThread
GM> property or the De/AttachThread methods. i just meant attach the socket 
reference in order to be used in the OnThreadTerminate 
GM> event (which is in the main thread).


>> I have one question regarding this... if some socket event come during
>> the  lengthly operation (OnDisconnect or OnDataAvailable for example),
>> will  they  be  triggered  during  operation or only at end of it ?
>> If  socket is MultiThread:=true it should use its own message queue so
>> react  instantly whenever the thread it is attached into is busy isn't
>> it ?

GM> if my purpose was to use socket within a thread context, this should be, 
yes, a constraint to take into account.
GM> The design i provided in the first mail is meant precisely not to bother 
with such constraints.

GM>  From Bjornar suggestion, if the client connection is closed, then all that 
has to be done is to stop/terminate the worker 
GM> thread if active.

GM> Regards,


GM> -- 

GM> Guillaume MAISON - [EMAIL PROTECTED]
GM> 83, Cours Victor Hugo
GM> 47000 AGEN
GM> Tél : 05 53 87 91 48 - Fax : 05 53 68 73 50
GM> e-mail : [EMAIL PROTECTED] - Web : http://nauteus.com

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


[twsocket] the 'close' and 'FIN'

2006-02-09 Thread Jeff Peng
hello,lists,


I have a pair of Client-Server Socket programs.When the client have finished
writing the datas,it should call the 'close()' to close the socket-end for
client.And,when the server receive the EOF coming from client,it should call
the 'close()' the close socket-end for server.Then the established socket
between client and server should be freed.

As we know,the close behavier under tcp socket is shown as below:

   Client   --->  FIN  --->  Server
   Client   <---  ACK  <---  Server

   Client   <---  FIN  <---  Server

   Server   --->  ACK  --->  Client



The question I want to know is,when the 'close()' call happened,if it should
generate a 'FIN' and send it to another end?If it's true,then at the server
end,when it receive the 'EOF' coming from client,it can delay for some time
to call 'close()',so the 'FIN' should not be sent to client immediately,is
it?

Thanks for replies.

--Jeff
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] [QUESTION] ThttpServer and threading design

2006-02-09 Thread Guillaume MAISON
Dod a écrit :
> Hello Guillaume,
> 
> Until know what I use to do is to create a worker thread and send jobs
> (with  pointer  to  socket  client object) and then worker send back a
> message  to socket thread with pointer of data to send back to client.
> So all socket things is done from same thread.
> Dettaching  clientsocket  from  socket thread to attach it into worker
> thread when starting lenghty operation is something I never did.

What you're doing is transfering a socket from main thread context to your work 
thread context.
My purpose is not the following. What i mean is executing all the SQL stuff 
within the thread,
and the connection stuff within the main thread. When i meant "attaching the 
socket" it was not using the MultiThread
property or the De/AttachThread methods. i just meant attach the socket 
reference in order to be used in the OnThreadTerminate 
event (which is in the main thread).


> I have one question regarding this... if some socket event come during
> the  lengthly operation (OnDisconnect or OnDataAvailable for example),
> will  they  be  triggered  during  operation or only at end of it ?
> If  socket is MultiThread:=true it should use its own message queue so
> react  instantly whenever the thread it is attached into is busy isn't
> it ?

if my purpose was to use socket within a thread context, this should be, yes, a 
constraint to take into account.
The design i provided in the first mail is meant precisely not to bother with 
such constraints.

 From Bjornar suggestion, if the client connection is closed, then all that has 
to be done is to stop/terminate the worker 
thread if active.

Regards,


-- 

Guillaume MAISON - [EMAIL PROTECTED]
83, Cours Victor Hugo
47000 AGEN
Tél : 05 53 87 91 48 - Fax : 05 53 68 73 50
e-mail : [EMAIL PROTECTED] - Web : http://nauteus.com

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] DNSQuery - bugreport

2006-02-09 Thread Wilfried Mestdagh
Hello Ann,

> I dont really understand what do you mean :(

Sorry, I try to be more clear next time..

> They are being created
> by main form and are being destroyed by timer on main form. I'm not
> creating separate thread or anything...

OK, then you have to set MultiThreading to False !!! It has only be set
to true if the component is created in a thread context, that is: "in"
the Execute method of a thread.

> It never occurs at first cycle.

OK, so I conclude that the basics in your program are ok.

> But maybe its important that 
> first error (after running application) is always "invalid pointer 
> operation".

Could be there is something before or after destroying. Or touching a
component after destroy. I assume you have an array of TDnsComponents ?
If so make the refernce nil after destroying. This is a good habitude.
And then check for nil on creation and on destroying.

Can you find the offending line of code with the first error ?

---
Rgds, Wilfried [TeamICS]
http://www.overbyte.be/eng/overbyte/teamics.html
http://www.mestdagh.biz

Thursday, February 9, 2006, 10:30, Ja wrote:

> I dont really understand what do you mean :( They are being created 
> by main form and are being destroyed by timer on main form. I'm not 
> creating separate thread or anything... But maybe its important that 
> first error (after running application) is always "invalid pointer 
> operation". It never occurs at first cycle.

> Greetings
> Ann

>  Wiadomość Oryginalna 
> Od: Wilfried Mestdagh <[EMAIL PROTECTED]>
> Do: ICS support mailing 
> Data: Thu, 9 Feb 2006 09:22:26 +0100
> Temat: Re: [twsocket] DNSQuery - bugreport

>> Hi Ann,
>> 
>> > Of course TDNSQuery is running in TCP mode and MultiThreaded is 
> set
>> > to True.
>> 
>> Do you execute it in a separate thread context ? Because that can 
> be the
>> reason of access violation. A component create / destroy should be 
> in
>> same thread context.
>> 
>> ---
>> Rgds, Wilfried [TeamICS]
>> http://www.overbyte.be/eng/overbyte/teamics.html
>> http://www.mestdagh.biz
>> 
>> Wednesday, February 8, 2006, 11:27, Ja wrote:
>> 
>> > Hi.
>> > I've made a bugreports from last 24h... could anybody help me to 
>> > analyze it?
>> 
>> > http://theweed.org/bugreport.txt
>> 
>> > What can i say is that bugs started when addeded checking few 
> names 
>> > with DNSQuery component every ... 10 minutes.
>> 
>> > How does it work?
>> > Every 10 minutes TDNSQuery component is being created for each 
>> > domain. In its tag it has tickcount (in seconds) for timeout. In 
>> > OnRequestDone every component marks in Listbox the result and 
> sets 
>> > it tag to -1 ... in the meantime timer4 is running... that 
> searches 
>> > for TDNSQuery components on the form, checking if the tag is -1 
> or 
>> > difference between tag and current tick count is more than 30 
>> > seconds... and destroys it.
>> 
>> > I've repaired bug with winsock buffer by changing interval to 10 
>> > minutes so system could close all sockets.
>> 
>> > Of course TDNSQuery is running in TCP mode and MultiThreaded is 
> set 
>> > to True.
>> 
>> > Please HELP me.
>> > Thank you!
>> > Ann
>> 
>> 
>> -- 
>> To unsubscribe or change your settings for TWSocket mailing list
>> please goto http://www.elists.org/mailman/listinfo/twsocket
>> Visit our website at http://www.overbyte.be
>> 


-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


[twsocket] about the socket close

2006-02-09 Thread Jeff Peng
hello,list,

I have a pair of Client-Server Socket programs.When the client have finished
writing the datas,it should call the 'close()' to close the socket-end for
client.And,when the server receive the EOF coming from client,it should call
the 'close()' the close socket-end for server.Then the established socket
between client and server should be freed.

As we know,the close behavier under tcp socket is shown as below:

 *  Client   --->  FIN  --->  Server*

*   Client   <---  ACK  <---  Server*

*   Client   <---  FIN  <---  Server*

   *Server   --->  ACK  --->  Client*

**

*The question I want to know is,when the 'close()' call happened,if it
should generate a 'FIN' and send it to another end?If it's true,then at the
server end,when it receive the 'EOF' coming from client,it can delay for
some time to call 'close()',so the 'FIN' should not be sent to client
immediately,is it?*

*Thanks for replies.*

**

**

*Jeff*
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] [QUESTION] ThttpServer and threading design

2006-02-09 Thread Dod
Hello Guillaume,

Until know what I use to do is to create a worker thread and send jobs
(with  pointer  to  socket  client object) and then worker send back a
message  to socket thread with pointer of data to send back to client.
So all socket things is done from same thread.

Dettaching  clientsocket  from  socket thread to attach it into worker
thread when starting lenghty operation is something I never did.

I have one question regarding this... if some socket event come during
the  lengthly operation (OnDisconnect or OnDataAvailable for example),
will  they  be  triggered  during  operation or only at end of it ?

If  socket is MultiThread:=true it should use its own message queue so
react  instantly whenever the thread it is attached into is busy isn't
it ?


GM> Bjørnar Nielsen a écrit :
>> I have a similar design, but I also have a pointer to the thread in the
>> THttpConnection so that the connection can set a flag on the thread if the
>> connection is dropped before the thread has finished the work and risk using
>> a freed connection.

GM> True ! i haven't seen it !

>> This design could serve several connections/threads at the same time.

GM> Thanks a lot !

GM> -- 

GM> Guillaume MAISON - [EMAIL PROTECTED]
GM> 83, Cours Victor Hugo
GM> 47000 AGEN
GM> Tél : 05 53 87 91 48 - Fax : 05 53 68 73 50
GM> e-mail : [EMAIL PROTECTED] - Web : http://nauteus.com

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] ICS help system?

2006-02-09 Thread DZ-Jay
On Feb 8, 2006, at 08:23, Tibor Csonka wrote:

> If DZ-Jay is offering hosting, then I can maybe do the Windows HTML 
> help
> importer, which will take the exported wiki data and build a html 
> source
> from it. I don't know the effort to do that but I'm willing to look at
> it if you like. Anyway it highly depends on the wiki system of choice
> for ICS (I mean the effort).

I have this hosted site that it is currently not being used for 
*anything*.  I will be glad to donate some (most?) of this space to 
host the ICS wiki if you guys want.

dZ.

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] POP3 Client - changing folders on the server

2006-02-09 Thread DZ-Jay
Hello:
With POP3, there is no notion of "folders" or any organization of 
messages.  It is just reads a single file.  When you said that your ISP 
added a spam folder, what do you mean? Did they add this to a WebMail 
application?  If so, this has nothing to do with the POP3 server.

dZ.

On Feb 8, 2006, at 17:09, John R. Dicks wrote:

> I have written an ap using the POP3 component to access mail from my
> ISP.  I can also access my email via the internet.  The ap  works
> perfectly, but my ISP has recently added a spam folder into which it
> places anything it considers to be spam.
>
> Is there a way to change to that folder using the POP3 component so I
> can check the headers in case something has gone in there that I want? 
> -
> or how else can I do it?
>
> Thanks
>
> John
> -- 
> To unsubscribe or change your settings for TWSocket mailing list
> please goto http://www.elists.org/mailman/listinfo/twsocket
> Visit our website at http://www.overbyte.be
>

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] [QUESTION] ThttpServer and threading design

2006-02-09 Thread Guillaume MAISON
Bjørnar Nielsen a écrit :
> I have a similar design, but I also have a pointer to the thread in the
> THttpConnection so that the connection can set a flag on the thread if the
> connection is dropped before the thread has finished the work and risk using
> a freed connection.

True ! i haven't seen it !

> This design could serve several connections/threads at the same time.

Thanks a lot !

-- 

Guillaume MAISON - [EMAIL PROTECTED]
83, Cours Victor Hugo
47000 AGEN
Tél : 05 53 87 91 48 - Fax : 05 53 68 73 50
e-mail : [EMAIL PROTECTED] - Web : http://nauteus.com

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] ICS help system?

2006-02-09 Thread Guillaume MAISON
Arno Garrels a écrit :
> 
> A wiki allows many users to work on the same stuff, that's something
> totally different. Help-comments in the source files would nullify this
> approach. 

Not completely true about nullification :)
Let's say there would be a really up-to-date version of the documentation 
within the source code.

 > However to generate an empty framework/skeleton it will probably
 > be necessary to use such a tool and to add a bare minimum of help-commands
 > to the sources. I for instance hate to read source code with such included
 > comments, of course this is a question taste.

This i agree with you ! ;)

Concerning ICS, of course, the documentation "space" would move from source 
code to the wiki...

-- 

Guillaume MAISON - [EMAIL PROTECTED]
83, Cours Victor Hugo
47000 AGEN
Tél : 05 53 87 91 48 - Fax : 05 53 68 73 50
e-mail : [EMAIL PROTECTED] - Web : http://nauteus.com

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] [QUESTION] ThttpServer and threading design

2006-02-09 Thread Bjørnar Nielsen
I have a similar design, but I also have a pointer to the thread in the
THttpConnection so that the connection can set a flag on the thread if the
connection is dropped before the thread has finished the work and risk using
a freed connection.

This design could serve several connections/threads at the same time.

Regards Bjørnar 

> -Original Message-
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of Guillaume MAISON
> Sent: 9. februar 2006 10:59
> To: ICS support mailing
> Subject: [twsocket] [QUESTION] ThttpServer and threading design
> 
> Hi everyone,
> 
> i've an application to write, a client and a server.
> i've choosen to use the HTTP protocol to enable communication 
> through them.
> Hence, i'll use the THttpServer as my server front-end.
> 
> my question is the following :
> some requests may use some database stuff (SQLite). It 
> shouldn't be the case, but, in case the SQL stuff may need 
> long duration (long>10 secs) i prefer to use threads to get 
> DB data, as there may be several clients connecting at the same time.
> 
> Am i right to implement such requests as this :
> Form.OnGetDocument :
>   Create a Thread with the HttpConnection attached and 
> FreeOnTerminate:=True;
>   Assign a OnThreadTerminate
>   Run the thread
>   Set Flags to hgWillSendMySelf
> 
> Form.OnThreadTerminate
>   AttachedHttpConnection.AnswerString/AnswerStream/AnswerWhatever
> 
> Does this design seem good ?
> i mean will i be able to serve several connections at the 
> same time (independantly of DB concurrential access that i'll 
> manage within thread context) ?
> 
> Thanks in advance for your help !
> 
> Regards,
> 
> 
> -- 
> 
> Guillaume MAISON - [EMAIL PROTECTED]
> 83, Cours Victor Hugo
> 47000 AGEN
> Tél : 05 53 87 91 48 - Fax : 05 53 68 73 50 e-mail : 
> [EMAIL PROTECTED] - Web : http://nauteus.com
> 
> --
> To unsubscribe or change your settings for TWSocket mailing 
> list please goto http://www.elists.org/mailman/listinfo/twsocket
> Visit our website at http://www.overbyte.be

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


[twsocket] [QUESTION] ThttpServer and threading design

2006-02-09 Thread Guillaume MAISON
Hi everyone,

i've an application to write, a client and a server.
i've choosen to use the HTTP protocol to enable communication through them.
Hence, i'll use the THttpServer as my server front-end.

my question is the following :
some requests may use some database stuff (SQLite). It shouldn't be the case, 
but,
in case the SQL stuff may need long duration (long>10 secs) i prefer to use 
threads to get DB data, as there may be several 
clients connecting at the same time.

Am i right to implement such requests as this :
Form.OnGetDocument :
Create a Thread with the HttpConnection attached and 
FreeOnTerminate:=True;
Assign a OnThreadTerminate
Run the thread
Set Flags to hgWillSendMySelf

Form.OnThreadTerminate
AttachedHttpConnection.AnswerString/AnswerStream/AnswerWhatever

Does this design seem good ?
i mean will i be able to serve several connections at the same time 
(independantly of DB concurrential access that i'll manage 
within thread context) ?

Thanks in advance for your help !

Regards,


-- 

Guillaume MAISON - [EMAIL PROTECTED]
83, Cours Victor Hugo
47000 AGEN
Tél : 05 53 87 91 48 - Fax : 05 53 68 73 50
e-mail : [EMAIL PROTECTED] - Web : http://nauteus.com

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] DNSQuery - bugreport

2006-02-09 Thread Ja
I dont really understand what do you mean :( They are being created 
by main form and are being destroyed by timer on main form. I'm not 
creating separate thread or anything... But maybe its important that 
first error (after running application) is always "invalid pointer 
operation". It never occurs at first cycle.

Greetings
Ann

 Wiadomość Oryginalna 
Od: Wilfried Mestdagh <[EMAIL PROTECTED]>
Do: ICS support mailing 
Data: Thu, 9 Feb 2006 09:22:26 +0100
Temat: Re: [twsocket] DNSQuery - bugreport

> Hi Ann,
> 
> > Of course TDNSQuery is running in TCP mode and MultiThreaded is 
set
> > to True.
> 
> Do you execute it in a separate thread context ? Because that can 
be the
> reason of access violation. A component create / destroy should be 
in
> same thread context.
> 
> ---
> Rgds, Wilfried [TeamICS]
> http://www.overbyte.be/eng/overbyte/teamics.html
> http://www.mestdagh.biz
> 
> Wednesday, February 8, 2006, 11:27, Ja wrote:
> 
> > Hi.
> > I've made a bugreports from last 24h... could anybody help me to 
> > analyze it?
> 
> > http://theweed.org/bugreport.txt
> 
> > What can i say is that bugs started when addeded checking few 
names 
> > with DNSQuery component every ... 10 minutes.
> 
> > How does it work?
> > Every 10 minutes TDNSQuery component is being created for each 
> > domain. In its tag it has tickcount (in seconds) for timeout. In 
> > OnRequestDone every component marks in Listbox the result and 
sets 
> > it tag to -1 ... in the meantime timer4 is running... that 
searches 
> > for TDNSQuery components on the form, checking if the tag is -1 
or 
> > difference between tag and current tick count is more than 30 
> > seconds... and destroys it.
> 
> > I've repaired bug with winsock buffer by changing interval to 10 
> > minutes so system could close all sockets.
> 
> > Of course TDNSQuery is running in TCP mode and MultiThreaded is 
set 
> > to True.
> 
> > Please HELP me.
> > Thank you!
> > Ann
> 
> 
> -- 
> To unsubscribe or change your settings for TWSocket mailing list
> please goto http://www.elists.org/mailman/listinfo/twsocket
> Visit our website at http://www.overbyte.be
> 

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] DNSQuery - bugreport

2006-02-09 Thread Wilfried Mestdagh
Hi Ann,

> Of course TDNSQuery is running in TCP mode and MultiThreaded is set
> to True.

Do you execute it in a separate thread context ? Because that can be the
reason of access violation. A component create / destroy should be in
same thread context.

---
Rgds, Wilfried [TeamICS]
http://www.overbyte.be/eng/overbyte/teamics.html
http://www.mestdagh.biz

Wednesday, February 8, 2006, 11:27, Ja wrote:

> Hi.
> I've made a bugreports from last 24h... could anybody help me to 
> analyze it?

> http://theweed.org/bugreport.txt

> What can i say is that bugs started when addeded checking few names 
> with DNSQuery component every ... 10 minutes.

> How does it work?
> Every 10 minutes TDNSQuery component is being created for each 
> domain. In its tag it has tickcount (in seconds) for timeout. In 
> OnRequestDone every component marks in Listbox the result and sets 
> it tag to -1 ... in the meantime timer4 is running... that searches 
> for TDNSQuery components on the form, checking if the tag is -1 or 
> difference between tag and current tick count is more than 30 
> seconds... and destroys it.

> I've repaired bug with winsock buffer by changing interval to 10 
> minutes so system could close all sockets.

> Of course TDNSQuery is running in TCP mode and MultiThreaded is set 
> to True.

> Please HELP me.
> Thank you!
> Ann


-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be