Re: [twsocket] small but pertinent doubt
Hello all, After some experiments and some (huge) line codes, I have some updates regarding this issue. I adopted TcpSrv example, I'm using TWSocketServer component and associated a new form for which client. In this way, each client updates the visual aspect of the form accordingly. I think this is the best option!? The results with 3 clients seems OK. I have some problems when I put the Sleep function in a client method, because the server stays blind to incoming data. Apart of that it is doing fine, Just one question: TWSocktetServer property Multithreaded is used for what? Thanks in advance Regards João -Mensagem original- De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Em nome de João Gonçalves Enviada: domingo, 6 de Abril de 2008 13:37 Para: 'ICS support mailing' Assunto: Re: [twsocket] small but pertinent doubt Thanks for the help. I you look into all these options and try to decide what's best. Regards, João -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Wilfried Mestdagh Sent: domingo, 6 de Abril de 2008 11:05 To: ICS support mailing Subject: Re: [twsocket] small but pertinent doubt Hello João, No you do not need thread to implement some flow control. First of all you may not update visual controls from within a thread, so you have to execute all this code in main thread context as well. Oke you can do that by SendMessage or PostMessage. Then if you need to display a from per client, it is the same problem. All has to be done in main thread context. So I think you will make it complicate if you use threads. You have to write thread safe code and do all updates in main thread context. So for the update of the main form table. I don't know exacly what you are doing, but if you do as follow: - client connect and send some data or whatever - when data is received you temporary store it somewhere and you disable then enable a Timer. - in OnTimer you update the table and delete the temporary data from each client. This way table will update some time after a client, and when many clients are updating it will wait a little for the update. Of cours other approachs are also possible, this is just an idea. Hope this helps. --- Rgds, Wilfried [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html http://www.mestdagh.biz Saturday, April 5, 2008, 19:33, João Gonçalves wrote: Let me explain why do I (think I) need a thread per client. I have a C++ builder app, with a main form, that has a table with the information of the status of several clients. When some client connects, it instantiates a new Form which is associated to each client. I can view (and drag) this form along the main form. The problem is: when a client is updating it status, on the main form's table, if there is another client doing the same, the table goes crazy. I think I have to use threads in order to introduce some flow control on the mains form's table. Am I thinking straight? Thank you João -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Wilfried Mestdagh Sent: sábado, 5 de Abril de 2008 16:27 To: ICS support mailing Subject: Re: [twsocket] small but pertinent doubt Hello João, If it is not in the list then I have to open all example files to see witch one. I know there is an example of running each client in separated thread. But are you sure you need a thread per client ??? --- Rgds, Wilfried [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html http://www.mestdagh.biz Saturday, April 5, 2008, 09:42, João Gonçalves wrote: Hello, once more thank you for your answer. I was referring to that list, I can't find the specific example that you speak. Are you referring to TcpSrv? Thanks João -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Wilfried Mestdagh Sent: sábado, 5 de Abril de 2008 8:26 To: ICS support mailing Subject: Re: [twsocket] small but pertinent doubt Hello João, Here http://www.overbyte.be/eng/products/ics.html#ics_apps is a complete discreption of all example files. --- Rgds, Wilfried [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html http://www.mestdagh.biz Saturday, April 5, 2008, 09:15, João Gonçalves wrote: Hello, Jus tone more thing: can youn point me to that example? I can't seem to find it:-( Thank you, João -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Wilfried Mestdagh Sent: sábado, 5 de Abril de 2008 0:38 To: ICS support mailing Subject: Re: [twsocket] small but pertinent doubt Hello João, As far as I recall is mtSrv an older example with a listening TWSocket and creating data-TWSockets for the clients. So the example with TWSocketServer is the way to go. TWSocketServer is not multithread because it is not needed. It can handle thousands of connections in main thread. But if you want you can make separate thread
Re: [twsocket] small but pertinent doubt
Hello João, No you do not need thread to implement some flow control. First of all you may not update visual controls from within a thread, so you have to execute all this code in main thread context as well. Oke you can do that by SendMessage or PostMessage. Then if you need to display a from per client, it is the same problem. All has to be done in main thread context. So I think you will make it complicate if you use threads. You have to write thread safe code and do all updates in main thread context. So for the update of the main form table. I don't know exacly what you are doing, but if you do as follow: - client connect and send some data or whatever - when data is received you temporary store it somewhere and you disable then enable a Timer. - in OnTimer you update the table and delete the temporary data from each client. This way table will update some time after a client, and when many clients are updating it will wait a little for the update. Of cours other approachs are also possible, this is just an idea. Hope this helps. --- Rgds, Wilfried [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html http://www.mestdagh.biz Saturday, April 5, 2008, 19:33, João Gonçalves wrote: Let me explain why do I (think I) need a thread per client. I have a C++ builder app, with a main form, that has a table with the information of the status of several clients. When some client connects, it instantiates a new Form which is associated to each client. I can view (and drag) this form along the main form. The problem is: when a client is updating it status, on the main form's table, if there is another client doing the same, the table goes crazy. I think I have to use threads in order to introduce some flow control on the mains form's table. Am I thinking straight? Thank you João -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Wilfried Mestdagh Sent: sábado, 5 de Abril de 2008 16:27 To: ICS support mailing Subject: Re: [twsocket] small but pertinent doubt Hello João, If it is not in the list then I have to open all example files to see witch one. I know there is an example of running each client in separated thread. But are you sure you need a thread per client ??? --- Rgds, Wilfried [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html http://www.mestdagh.biz Saturday, April 5, 2008, 09:42, João Gonçalves wrote: Hello, once more thank you for your answer. I was referring to that list, I can't find the specific example that you speak. Are you referring to TcpSrv? Thanks João -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Wilfried Mestdagh Sent: sábado, 5 de Abril de 2008 8:26 To: ICS support mailing Subject: Re: [twsocket] small but pertinent doubt Hello João, Here http://www.overbyte.be/eng/products/ics.html#ics_apps is a complete discreption of all example files. --- Rgds, Wilfried [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html http://www.mestdagh.biz Saturday, April 5, 2008, 09:15, João Gonçalves wrote: Hello, Jus tone more thing: can youn point me to that example? I can't seem to find it:-( Thank you, João -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Wilfried Mestdagh Sent: sábado, 5 de Abril de 2008 0:38 To: ICS support mailing Subject: Re: [twsocket] small but pertinent doubt Hello João, As far as I recall is mtSrv an older example with a listening TWSocket and creating data-TWSockets for the clients. So the example with TWSocketServer is the way to go. TWSocketServer is not multithread because it is not needed. It can handle thousands of connections in main thread. But if you want you can make separate thread for each client or for groups of clients if you have for example lengthy code to execute. There is an example with TWSocketServer also multitrheaded. --- Rgds, Wilfried [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html http://www.mestdagh.biz Friday, April 4, 2008, 22:45, João Gonçalves wrote: Hello, thank you for the answer In the application that I developed, taking the base of TcpSrv, I use TWSocketServer, 2 questions: - Is this multithread? - Is it better than MtSRv? Thank you João -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Wilfried Mestdagh Sent: sexta-feira, 4 de Abril de 2008 8:29 To: ICS support mailing Subject: Re: [twsocket] small but pertinent doubt Hello João, Use TWSocketServer component wich handles all clients by itself. There are some example files. --- Rgds, Wilfried [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html http://www.mestdagh.biz Thursday, April 3, 2008, 23:17, João Gonçalves wrote: Hello, I developed an application in C++ Builder, based on the example TcpSrv. It works very well, for a single client. Im now trying
Re: [twsocket] small but pertinent doubt
Thanks for the help. I you look into all these options and try to decide what's best. Regards, João -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Wilfried Mestdagh Sent: domingo, 6 de Abril de 2008 11:05 To: ICS support mailing Subject: Re: [twsocket] small but pertinent doubt Hello João, No you do not need thread to implement some flow control. First of all you may not update visual controls from within a thread, so you have to execute all this code in main thread context as well. Oke you can do that by SendMessage or PostMessage. Then if you need to display a from per client, it is the same problem. All has to be done in main thread context. So I think you will make it complicate if you use threads. You have to write thread safe code and do all updates in main thread context. So for the update of the main form table. I don't know exacly what you are doing, but if you do as follow: - client connect and send some data or whatever - when data is received you temporary store it somewhere and you disable then enable a Timer. - in OnTimer you update the table and delete the temporary data from each client. This way table will update some time after a client, and when many clients are updating it will wait a little for the update. Of cours other approachs are also possible, this is just an idea. Hope this helps. --- Rgds, Wilfried [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html http://www.mestdagh.biz Saturday, April 5, 2008, 19:33, João Gonçalves wrote: Let me explain why do I (think I) need a thread per client. I have a C++ builder app, with a main form, that has a table with the information of the status of several clients. When some client connects, it instantiates a new Form which is associated to each client. I can view (and drag) this form along the main form. The problem is: when a client is updating it status, on the main form's table, if there is another client doing the same, the table goes crazy. I think I have to use threads in order to introduce some flow control on the mains form's table. Am I thinking straight? Thank you João -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Wilfried Mestdagh Sent: sábado, 5 de Abril de 2008 16:27 To: ICS support mailing Subject: Re: [twsocket] small but pertinent doubt Hello João, If it is not in the list then I have to open all example files to see witch one. I know there is an example of running each client in separated thread. But are you sure you need a thread per client ??? --- Rgds, Wilfried [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html http://www.mestdagh.biz Saturday, April 5, 2008, 09:42, João Gonçalves wrote: Hello, once more thank you for your answer. I was referring to that list, I can't find the specific example that you speak. Are you referring to TcpSrv? Thanks João -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Wilfried Mestdagh Sent: sábado, 5 de Abril de 2008 8:26 To: ICS support mailing Subject: Re: [twsocket] small but pertinent doubt Hello João, Here http://www.overbyte.be/eng/products/ics.html#ics_apps is a complete discreption of all example files. --- Rgds, Wilfried [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html http://www.mestdagh.biz Saturday, April 5, 2008, 09:15, João Gonçalves wrote: Hello, Jus tone more thing: can youn point me to that example? I can't seem to find it:-( Thank you, João -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Wilfried Mestdagh Sent: sábado, 5 de Abril de 2008 0:38 To: ICS support mailing Subject: Re: [twsocket] small but pertinent doubt Hello João, As far as I recall is mtSrv an older example with a listening TWSocket and creating data-TWSockets for the clients. So the example with TWSocketServer is the way to go. TWSocketServer is not multithread because it is not needed. It can handle thousands of connections in main thread. But if you want you can make separate thread for each client or for groups of clients if you have for example lengthy code to execute. There is an example with TWSocketServer also multitrheaded. --- Rgds, Wilfried [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html http://www.mestdagh.biz Friday, April 4, 2008, 22:45, João Gonçalves wrote: Hello, thank you for the answer In the application that I developed, taking the base of TcpSrv, I use TWSocketServer, 2 questions: - Is this multithread? - Is it better than MtSRv? Thank you João -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Wilfried Mestdagh Sent: sexta-feira, 4 de Abril de 2008 8:29 To: ICS support mailing Subject: Re: [twsocket] small but pertinent doubt Hello João, Use TWSocketServer component wich handles all clients by itself
Re: [twsocket] small but pertinent doubt
Hello, Jus tone more thing: can youn point me to that example? I can't seem to find it:-( Thank you, João -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Wilfried Mestdagh Sent: sábado, 5 de Abril de 2008 0:38 To: ICS support mailing Subject: Re: [twsocket] small but pertinent doubt Hello João, As far as I recall is mtSrv an older example with a listening TWSocket and creating data-TWSockets for the clients. So the example with TWSocketServer is the way to go. TWSocketServer is not multithread because it is not needed. It can handle thousands of connections in main thread. But if you want you can make separate thread for each client or for groups of clients if you have for example lengthy code to execute. There is an example with TWSocketServer also multitrheaded. --- Rgds, Wilfried [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html http://www.mestdagh.biz Friday, April 4, 2008, 22:45, João Gonçalves wrote: Hello, thank you for the answer In the application that I developed, taking the base of TcpSrv, I use TWSocketServer, 2 questions: - Is this multithread? - Is it better than MtSRv? Thank you João -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Wilfried Mestdagh Sent: sexta-feira, 4 de Abril de 2008 8:29 To: ICS support mailing Subject: Re: [twsocket] small but pertinent doubt Hello João, Use TWSocketServer component wich handles all clients by itself. There are some example files. --- Rgds, Wilfried [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html http://www.mestdagh.biz Thursday, April 3, 2008, 23:17, João Gonçalves wrote: Hello, I developed an application in C++ Builder, based on the example TcpSrv. It works very well, for a single client. Im now trying to use several clients, looking to the documentation, ICS has 2 examples: MtSrv and TnSrv, they booth say that this should be used for a real world server. My question (doubt) is: what is more suitable to use? Thank in advance João -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] small but pertinent doubt
Hello João, Here http://www.overbyte.be/eng/products/ics.html#ics_apps is a complete discreption of all example files. --- Rgds, Wilfried [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html http://www.mestdagh.biz Saturday, April 5, 2008, 09:15, João Gonçalves wrote: Hello, Jus tone more thing: can youn point me to that example? I can't seem to find it:-( Thank you, João -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Wilfried Mestdagh Sent: sábado, 5 de Abril de 2008 0:38 To: ICS support mailing Subject: Re: [twsocket] small but pertinent doubt Hello João, As far as I recall is mtSrv an older example with a listening TWSocket and creating data-TWSockets for the clients. So the example with TWSocketServer is the way to go. TWSocketServer is not multithread because it is not needed. It can handle thousands of connections in main thread. But if you want you can make separate thread for each client or for groups of clients if you have for example lengthy code to execute. There is an example with TWSocketServer also multitrheaded. --- Rgds, Wilfried [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html http://www.mestdagh.biz Friday, April 4, 2008, 22:45, João Gonçalves wrote: Hello, thank you for the answer In the application that I developed, taking the base of TcpSrv, I use TWSocketServer, 2 questions: - Is this multithread? - Is it better than MtSRv? Thank you João -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Wilfried Mestdagh Sent: sexta-feira, 4 de Abril de 2008 8:29 To: ICS support mailing Subject: Re: [twsocket] small but pertinent doubt Hello João, Use TWSocketServer component wich handles all clients by itself. There are some example files. --- Rgds, Wilfried [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html http://www.mestdagh.biz Thursday, April 3, 2008, 23:17, João Gonçalves wrote: Hello, I developed an application in C++ Builder, based on the example TcpSrv. It works very well, for a single client. Im now trying to use several clients, looking to the documentation, ICS has 2 examples: MtSrv and TnSrv, they booth say that this should be used for a real world server. My question (doubt) is: what is more suitable to use? Thank in advance João -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] small but pertinent doubt
Hello, once more thank you for your answer. I was referring to that list, I can't find the specific example that you speak. Are you referring to TcpSrv? Thanks João -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Wilfried Mestdagh Sent: sábado, 5 de Abril de 2008 8:26 To: ICS support mailing Subject: Re: [twsocket] small but pertinent doubt Hello João, Here http://www.overbyte.be/eng/products/ics.html#ics_apps is a complete discreption of all example files. --- Rgds, Wilfried [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html http://www.mestdagh.biz Saturday, April 5, 2008, 09:15, João Gonçalves wrote: Hello, Jus tone more thing: can youn point me to that example? I can't seem to find it:-( Thank you, João -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Wilfried Mestdagh Sent: sábado, 5 de Abril de 2008 0:38 To: ICS support mailing Subject: Re: [twsocket] small but pertinent doubt Hello João, As far as I recall is mtSrv an older example with a listening TWSocket and creating data-TWSockets for the clients. So the example with TWSocketServer is the way to go. TWSocketServer is not multithread because it is not needed. It can handle thousands of connections in main thread. But if you want you can make separate thread for each client or for groups of clients if you have for example lengthy code to execute. There is an example with TWSocketServer also multitrheaded. --- Rgds, Wilfried [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html http://www.mestdagh.biz Friday, April 4, 2008, 22:45, João Gonçalves wrote: Hello, thank you for the answer In the application that I developed, taking the base of TcpSrv, I use TWSocketServer, 2 questions: - Is this multithread? - Is it better than MtSRv? Thank you João -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Wilfried Mestdagh Sent: sexta-feira, 4 de Abril de 2008 8:29 To: ICS support mailing Subject: Re: [twsocket] small but pertinent doubt Hello João, Use TWSocketServer component wich handles all clients by itself. There are some example files. --- Rgds, Wilfried [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html http://www.mestdagh.biz Thursday, April 3, 2008, 23:17, João Gonçalves wrote: Hello, I developed an application in C++ Builder, based on the example TcpSrv. It works very well, for a single client. Im now trying to use several clients, looking to the documentation, ICS has 2 examples: MtSrv and TnSrv, they booth say that this should be used for a real world server. My question (doubt) is: what is more suitable to use? Thank in advance João -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] small but pertinent doubt
Hello João, One more thing, I recommend you to create the TWSocketServer into a separated thread just to avoid your appplication interface to be overloaded/non responsive in case of hudge activity. You can also dettach some client sockets and attach them into some separated thread if they may take longer time to execute (for exemple long database request or disk file activity). As ICS uses an event driven model this permit to manage very easy tons of connections but you must be responsive and make each triggered event finish as fast as possible or the next event (for exemple an other OnDataAvailable for other client) will have to wait. You may also create some worker thread that you can send thoses longer operation the release the event faster. Regards. JG Hello, JG Jus tone more thing: can youn point me to that example? I can't seem to find JG it:-( JG Thank you, JG João JG -Original Message- JG From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On JG Behalf Of Wilfried Mestdagh JG Sent: sábado, 5 de Abril de 2008 0:38 JG To: ICS support mailing JG Subject: Re: [twsocket] small but pertinent doubt JG Hello João, JG As far as I recall is mtSrv an older example with a listening TWSocket JG and creating data-TWSockets for the clients. So the example with JG TWSocketServer is the way to go. JG TWSocketServer is not multithread because it is not needed. It can JG handle thousands of connections in main thread. But if you want you can JG make separate thread for each client or for groups of clients if you JG have for example lengthy code to execute. There is an example with JG TWSocketServer also multitrheaded. JG --- JG Rgds, Wilfried [TeamICS] JG http://www.overbyte.be/eng/overbyte/teamics.html JG http://www.mestdagh.biz JG Friday, April 4, 2008, 22:45, João Gonçalves wrote: Hello, thank you for the answer In the application that I developed, taking the base of TcpSrv, I use TWSocketServer, 2 questions: - Is this multithread? - Is it better than MtSRv? Thank you João -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Wilfried Mestdagh Sent: sexta-feira, 4 de Abril de 2008 8:29 To: ICS support mailing Subject: Re: [twsocket] small but pertinent doubt Hello João, Use TWSocketServer component wich handles all clients by itself. There are some example files. --- Rgds, Wilfried [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html http://www.mestdagh.biz Thursday, April 3, 2008, 23:17, João Gonçalves wrote: Hello, I developed an application in C++ Builder, based on the example TcpSrv. JG It works very well, for a single client. Im now trying to use several clients, looking to the documentation, ICS has 2 examples: MtSrv and TnSrv, they booth say that this should be used for a real world server. My question (doubt) is: what is more suitable to use? Thank in advance João -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be JG -- JG To unsubscribe or change your settings for TWSocket mailing list JG please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket JG Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] small but pertinent doubt
OK, let me se if I understood The best option is to take the TCpSrv example from ICs, put it on a new Thread, and create a new Thread for each client, like the example on the MtSrv? Is this line of thinking correct? Thanks once more João -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Dod Sent: sábado, 5 de Abril de 2008 8:45 To: ICS support mailing Subject: Re: [twsocket] small but pertinent doubt Hello João, One more thing, I recommend you to create the TWSocketServer into a separated thread just to avoid your appplication interface to be overloaded/non responsive in case of hudge activity. You can also dettach some client sockets and attach them into some separated thread if they may take longer time to execute (for exemple long database request or disk file activity). As ICS uses an event driven model this permit to manage very easy tons of connections but you must be responsive and make each triggered event finish as fast as possible or the next event (for exemple an other OnDataAvailable for other client) will have to wait. You may also create some worker thread that you can send thoses longer operation the release the event faster. Regards. JG Hello, JG Jus tone more thing: can youn point me to that example? I can't seem to find JG it:-( JG Thank you, JG João JG -Original Message- JG From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On JG Behalf Of Wilfried Mestdagh JG Sent: sábado, 5 de Abril de 2008 0:38 JG To: ICS support mailing JG Subject: Re: [twsocket] small but pertinent doubt JG Hello João, JG As far as I recall is mtSrv an older example with a listening TWSocket JG and creating data-TWSockets for the clients. So the example with JG TWSocketServer is the way to go. JG TWSocketServer is not multithread because it is not needed. It can JG handle thousands of connections in main thread. But if you want you can JG make separate thread for each client or for groups of clients if you JG have for example lengthy code to execute. There is an example with JG TWSocketServer also multitrheaded. JG --- JG Rgds, Wilfried [TeamICS] JG http://www.overbyte.be/eng/overbyte/teamics.html JG http://www.mestdagh.biz JG Friday, April 4, 2008, 22:45, João Gonçalves wrote: Hello, thank you for the answer In the application that I developed, taking the base of TcpSrv, I use TWSocketServer, 2 questions: - Is this multithread? - Is it better than MtSRv? Thank you João -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Wilfried Mestdagh Sent: sexta-feira, 4 de Abril de 2008 8:29 To: ICS support mailing Subject: Re: [twsocket] small but pertinent doubt Hello João, Use TWSocketServer component wich handles all clients by itself. There are some example files. --- Rgds, Wilfried [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html http://www.mestdagh.biz Thursday, April 3, 2008, 23:17, João Gonçalves wrote: Hello, I developed an application in C++ Builder, based on the example TcpSrv. JG It works very well, for a single client. Im now trying to use several clients, looking to the documentation, ICS has 2 examples: MtSrv and TnSrv, they booth say that this should be used for a real world server. My question (doubt) is: what is more suitable to use? Thank in advance João -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be JG -- JG To unsubscribe or change your settings for TWSocket mailing list JG please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket JG Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] small but pertinent doubt
Hello João, No, Put only the main TWSockerServer into a separated thread, that's all, this is if your applicationis not a service and has a graphical interface (one or more windows), so even if you have hudge network activity, your buttons/menus in your forms will stay responsive. Making one thread per client is non-sense using asynchronous ICS model. But eventually, you may create some worker thread or temporary thread that will proceed some longer requests without queueing for too long time all other events ICS sockets will receive. Regards. JG OK, let me se if I understood JG The best option is to take the TCpSrv example from ICs, put it on a new JG Thread, and create a new Thread for each client, like the example on the JG MtSrv? JG Is this line of thinking correct? JG Thanks once more JG João JG -Original Message- JG From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On JG Behalf Of Dod JG Sent: sábado, 5 de Abril de 2008 8:45 JG To: ICS support mailing JG Subject: Re: [twsocket] small but pertinent doubt JG Hello João, JG One more thing, I recommend you to create the TWSocketServer into a JG separated thread just to avoid your appplication interface to be JG overloaded/non responsive in case of hudge activity. JG You can also dettach some client sockets and attach them into some JG separated thread if they may take longer time to execute (for exemple JG long database request or disk file activity). JG As ICS uses an event driven model this permit to manage very easy tons JG of connections but you must be responsive and make each triggered JG event finish as fast as possible or the next event (for exemple an JG other OnDataAvailable for other client) will have to wait. JG You may also create some worker thread that you can send thoses longer JG operation the release the event faster. JG Regards. JG Hello, JG Jus tone more thing: can youn point me to that example? I can't seem to JG find JG it:-( JG Thank you, JG João JG -Original Message- JG From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] JG On JG Behalf Of Wilfried Mestdagh JG Sent: sábado, 5 de Abril de 2008 0:38 JG To: ICS support mailing JG Subject: Re: [twsocket] small but pertinent doubt JG Hello João, JG As far as I recall is mtSrv an older example with a listening TWSocket JG and creating data-TWSockets for the clients. So the example with JG TWSocketServer is the way to go. JG TWSocketServer is not multithread because it is not needed. It can JG handle thousands of connections in main thread. But if you want you can JG make separate thread for each client or for groups of clients if you JG have for example lengthy code to execute. There is an example with JG TWSocketServer also multitrheaded. JG --- JG Rgds, Wilfried [TeamICS] JG http://www.overbyte.be/eng/overbyte/teamics.html JG http://www.mestdagh.biz JG Friday, April 4, 2008, 22:45, João Gonçalves wrote: Hello, thank you for the answer In the application that I developed, taking the base of TcpSrv, I use TWSocketServer, 2 questions: - Is this multithread? - Is it better than MtSRv? Thank you João -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Wilfried Mestdagh Sent: sexta-feira, 4 de Abril de 2008 8:29 To: ICS support mailing Subject: Re: [twsocket] small but pertinent doubt Hello João, Use TWSocketServer component wich handles all clients by itself. There are some example files. --- Rgds, Wilfried [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html http://www.mestdagh.biz Thursday, April 3, 2008, 23:17, João Gonçalves wrote: Hello, I developed an application in C++ Builder, based on the example TcpSrv. JG It works very well, for a single client. Im now trying to use several clients, looking to the documentation, ICS has 2 examples: MtSrv and TnSrv, they booth say that this should be used for a real world server. My question (doubt) is: what is more suitable to use? Thank in advance João -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be JG -- JG To unsubscribe or change your settings for TWSocket mailing list JG please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket JG Visit our website at http://www.overbyte.be JG -- JG To unsubscribe or change your settings for TWSocket mailing list JG please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket JG Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] small but pertinent doubt
Hello João, If it is not in the list then I have to open all example files to see witch one. I know there is an example of running each client in separated thread. But are you sure you need a thread per client ??? --- Rgds, Wilfried [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html http://www.mestdagh.biz Saturday, April 5, 2008, 09:42, João Gonçalves wrote: Hello, once more thank you for your answer. I was referring to that list, I can't find the specific example that you speak. Are you referring to TcpSrv? Thanks João -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Wilfried Mestdagh Sent: sábado, 5 de Abril de 2008 8:26 To: ICS support mailing Subject: Re: [twsocket] small but pertinent doubt Hello João, Here http://www.overbyte.be/eng/products/ics.html#ics_apps is a complete discreption of all example files. --- Rgds, Wilfried [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html http://www.mestdagh.biz Saturday, April 5, 2008, 09:15, João Gonçalves wrote: Hello, Jus tone more thing: can youn point me to that example? I can't seem to find it:-( Thank you, João -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Wilfried Mestdagh Sent: sábado, 5 de Abril de 2008 0:38 To: ICS support mailing Subject: Re: [twsocket] small but pertinent doubt Hello João, As far as I recall is mtSrv an older example with a listening TWSocket and creating data-TWSockets for the clients. So the example with TWSocketServer is the way to go. TWSocketServer is not multithread because it is not needed. It can handle thousands of connections in main thread. But if you want you can make separate thread for each client or for groups of clients if you have for example lengthy code to execute. There is an example with TWSocketServer also multitrheaded. --- Rgds, Wilfried [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html http://www.mestdagh.biz Friday, April 4, 2008, 22:45, João Gonçalves wrote: Hello, thank you for the answer In the application that I developed, taking the base of TcpSrv, I use TWSocketServer, 2 questions: - Is this multithread? - Is it better than MtSRv? Thank you João -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Wilfried Mestdagh Sent: sexta-feira, 4 de Abril de 2008 8:29 To: ICS support mailing Subject: Re: [twsocket] small but pertinent doubt Hello João, Use TWSocketServer component wich handles all clients by itself. There are some example files. --- Rgds, Wilfried [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html http://www.mestdagh.biz Thursday, April 3, 2008, 23:17, João Gonçalves wrote: Hello, I developed an application in C++ Builder, based on the example TcpSrv. It works very well, for a single client. Im now trying to use several clients, looking to the documentation, ICS has 2 examples: MtSrv and TnSrv, they booth say that this should be used for a real world server. My question (doubt) is: what is more suitable to use? Thank in advance João -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] small but pertinent doubt
Let me explain why do I (think I) need a thread per client. I have a C++ builder app, with a main form, that has a table with the information of the status of several clients. When some client connects, it instantiates a new Form which is associated to each client. I can view (and drag) this form along the main form. The problem is: when a client is updating it status, on the main form's table, if there is another client doing the same, the table goes crazy. I think I have to use threads in order to introduce some flow control on the mains form's table. Am I thinking straight? Thank you João -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Wilfried Mestdagh Sent: sábado, 5 de Abril de 2008 16:27 To: ICS support mailing Subject: Re: [twsocket] small but pertinent doubt Hello João, If it is not in the list then I have to open all example files to see witch one. I know there is an example of running each client in separated thread. But are you sure you need a thread per client ??? --- Rgds, Wilfried [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html http://www.mestdagh.biz Saturday, April 5, 2008, 09:42, João Gonçalves wrote: Hello, once more thank you for your answer. I was referring to that list, I can't find the specific example that you speak. Are you referring to TcpSrv? Thanks João -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Wilfried Mestdagh Sent: sábado, 5 de Abril de 2008 8:26 To: ICS support mailing Subject: Re: [twsocket] small but pertinent doubt Hello João, Here http://www.overbyte.be/eng/products/ics.html#ics_apps is a complete discreption of all example files. --- Rgds, Wilfried [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html http://www.mestdagh.biz Saturday, April 5, 2008, 09:15, João Gonçalves wrote: Hello, Jus tone more thing: can youn point me to that example? I can't seem to find it:-( Thank you, João -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Wilfried Mestdagh Sent: sábado, 5 de Abril de 2008 0:38 To: ICS support mailing Subject: Re: [twsocket] small but pertinent doubt Hello João, As far as I recall is mtSrv an older example with a listening TWSocket and creating data-TWSockets for the clients. So the example with TWSocketServer is the way to go. TWSocketServer is not multithread because it is not needed. It can handle thousands of connections in main thread. But if you want you can make separate thread for each client or for groups of clients if you have for example lengthy code to execute. There is an example with TWSocketServer also multitrheaded. --- Rgds, Wilfried [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html http://www.mestdagh.biz Friday, April 4, 2008, 22:45, João Gonçalves wrote: Hello, thank you for the answer In the application that I developed, taking the base of TcpSrv, I use TWSocketServer, 2 questions: - Is this multithread? - Is it better than MtSRv? Thank you João -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Wilfried Mestdagh Sent: sexta-feira, 4 de Abril de 2008 8:29 To: ICS support mailing Subject: Re: [twsocket] small but pertinent doubt Hello João, Use TWSocketServer component wich handles all clients by itself. There are some example files. --- Rgds, Wilfried [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html http://www.mestdagh.biz Thursday, April 3, 2008, 23:17, João Gonçalves wrote: Hello, I developed an application in C++ Builder, based on the example TcpSrv. It works very well, for a single client. Im now trying to use several clients, looking to the documentation, ICS has 2 examples: MtSrv and TnSrv, they booth say that this should be used for a real world server. My question (doubt) is: what is more suitable to use? Thank in advance João -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] small but pertinent doubt
Hello João, Use TWSocketServer component wich handles all clients by itself. There are some example files. --- Rgds, Wilfried [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html http://www.mestdagh.biz Thursday, April 3, 2008, 23:17, João Gonçalves wrote: Hello, I developed an application in C++ Builder, based on the example TcpSrv. It works very well, for a single client. Im now trying to use several clients, looking to the documentation, ICS has 2 examples: MtSrv and TnSrv, they booth say that this should be used for a real world server. My question (doubt) is: what is more suitable to use? Thank in advance João -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] small but pertinent doubt
Hello, thank you for the answer In the application that I developed, taking the base of TcpSrv, I use TWSocketServer, 2 questions: - Is this multithread? - Is it better than MtSRv? Thank you João -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Wilfried Mestdagh Sent: sexta-feira, 4 de Abril de 2008 8:29 To: ICS support mailing Subject: Re: [twsocket] small but pertinent doubt Hello João, Use TWSocketServer component wich handles all clients by itself. There are some example files. --- Rgds, Wilfried [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html http://www.mestdagh.biz Thursday, April 3, 2008, 23:17, João Gonçalves wrote: Hello, I developed an application in C++ Builder, based on the example TcpSrv. It works very well, for a single client. Im now trying to use several clients, looking to the documentation, ICS has 2 examples: MtSrv and TnSrv, they booth say that this should be used for a real world server. My question (doubt) is: what is more suitable to use? Thank in advance João -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] small but pertinent doubt
Hello João, As far as I recall is mtSrv an older example with a listening TWSocket and creating data-TWSockets for the clients. So the example with TWSocketServer is the way to go. TWSocketServer is not multithread because it is not needed. It can handle thousands of connections in main thread. But if you want you can make separate thread for each client or for groups of clients if you have for example lengthy code to execute. There is an example with TWSocketServer also multitrheaded. --- Rgds, Wilfried [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html http://www.mestdagh.biz Friday, April 4, 2008, 22:45, João Gonçalves wrote: Hello, thank you for the answer In the application that I developed, taking the base of TcpSrv, I use TWSocketServer, 2 questions: - Is this multithread? - Is it better than MtSRv? Thank you João -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Wilfried Mestdagh Sent: sexta-feira, 4 de Abril de 2008 8:29 To: ICS support mailing Subject: Re: [twsocket] small but pertinent doubt Hello João, Use TWSocketServer component wich handles all clients by itself. There are some example files. --- Rgds, Wilfried [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html http://www.mestdagh.biz Thursday, April 3, 2008, 23:17, João Gonçalves wrote: Hello, I developed an application in C++ Builder, based on the example TcpSrv. It works very well, for a single client. Im now trying to use several clients, looking to the documentation, ICS has 2 examples: MtSrv and TnSrv, they booth say that this should be used for a real world server. My question (doubt) is: what is more suitable to use? Thank in advance João -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
[twsocket] small but pertinent doubt
Hello, I developed an application in C++ Builder, based on the example TcpSrv. It works very well, for a single client. Im now trying to use several clients, looking to the documentation, ICS has 2 examples: MtSrv and TnSrv, they booth say that this should be used for a real world server. My question (doubt) is: what is more suitable to use? Thank in advance João -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be