Re: [twsocket] Wiki

2007-09-26 Thread Francois PIETTE
>>maybe some of the people around here have forgotten that a Wiki >>for ICS exists http://wiki.overbyte.be/wiki/index.php/Main_Page. > I agree! I see it as "paying" a little for the components by documenting >when I am doing some development with ICS-components. It's so easy to >add a couple of li

Re: [twsocket] Wiki

2007-09-26 Thread Fredrik Larsson
Hi, I agree! I see it as "paying" a little for the components by documenting when I am doing some development with ICS-components. It's so easy to add a couple of lines of code or some notes that are missing. Regards, Fredrik. -Ursprungligt meddelande- Från: [EMAIL PROTECTED] [mailto:[E

[twsocket] Wiki

2007-09-26 Thread Markus Humm
Hello, maybe some of the people around here have forgotten that a Wiki for ICS exists http://wiki.overbyte.be/wiki/index.php/Main_Page. I think it always seeks for more contributors, so just get yourself a login and start to add or revise content... Greetings Markus -- To unsubscribe or chan

Re: [twsocket] newb using TWSocket for the first time

2007-09-26 Thread Arno Garrels
David Perkins wrote: > By custom message handler, do you mean use a message map and define a > new message type something like WM_USER+100? Yes, you can also post the custom message to the hidden window that all ICS components own and override component's WndProc() to handle the new message, not

Re: [twsocket] newb using TWSocket for the first time

2007-09-26 Thread David Perkins
Thanks Wilfried/Francois At the moment this is just for a simple test app that talks to a third-party server. My comms class allows the GUI (or any class for that matter) to register an event to be called when a certain data packet is received via the socket. It just so happens in this case that

Re: [twsocket] newb using TWSocket for the first time

2007-09-26 Thread Francois Piette
> I now suspect that the data is only being sent once. > > When I receive a certain packet I pop up a messagebox asking the user > a question and I suspect it is this that is causing the packet to be > repeated since it is ultimately being displayed by a call from the > OnDataAvailable event. > > H

Re: [twsocket] TWSocket multi-client example

2007-09-26 Thread Francois Piette
> I need to write a TService application that will > receive (potentially) multiple client TCP connections > concurrently, and perform some simple stateful > transactions with them. For example: > > 1. Client-A connects to the server > 2. Server responds with banner > 3. Client-A sends data >

Re: [twsocket] newb using TWSocket for the first time

2007-09-26 Thread Wilfried Mestdagh
Hello David, Yes, a modal form is pumping messages. If it is really nececary to popup a form if you have received a certain packet, you have to create / show the form "outside" the OnDataAvailable event. To do it outside just post a message to a custom message handler. Your custom message handler

[twsocket] TWSocket multi-client example

2007-09-26 Thread [EMAIL PROTECTED]
Hello: I need to write a TService application that will receive (potentially) multiple client TCP connections concurrently, and perform some simple stateful transactions with them. For example: 1. Client-A connects to the server 2. Server responds with banner 3. Client-A sends data 4. Client-

Re: [twsocket] newb using TWSocket for the first time

2007-09-26 Thread David Perkins
I now suspect that the data is only being sent once. When I receive a certain packet I pop up a messagebox asking the user a question and I suspect it is this that is causing the packet to be repeated since it is ultimately being displayed by a call from the OnDataAvailable event. How may this be

Re: [twsocket] 100% CPU usage if data is not processed immediately

2007-09-26 Thread Arno Garrels
Olivier Sannier wrote: > That's what I thought, but then again, this means I need to have a > buffer of my own, and I have no idea which size it should be. 1k, > 10k, more? You have to use some buffer, its size depends on your protocol. I.e. the client could send the data length as the first byt

Re: [twsocket] 100% CPU usage if data is not processed immediately

2007-09-26 Thread Wilfried Mestdagh
Hello Olivier, > That's what I thought, but then again, this means I need to have a > buffer of my own, and I have no idea which size it should be. 1k, 10k, more? Yes. TWSocket is designed to buffer incoming data for you if you use LineMode. That is when you have your data terminated with a certa

Re: [twsocket] Newbie question : Working with Long strings

2007-09-26 Thread Wilfried Mestdagh
Hello Clément, > Ok. But can I place a LineLimit over 200kbytes? or better yet, > unlimited? (those help files can get very big may be over 1Mb) Yes. Since you connect to a known server you dont have to be afraid of a DOS attac. So set LineLimit := $7FFF; which is the highest possible value.

Re: [twsocket] 100% CPU usage if data is not processed immediately

2007-09-26 Thread Arno Garrels
Olivier Sannier wrote: > > if bMore then > Sleep(1); { to avoid 100% CPU } > > At line 4231, right after the end of the try except block. > To me this has little to no effect as the sleep is only done when > bMore is True. > What do you think of this proposal? That would slo

Re: [twsocket] 100% CPU usage if data is not processed immediately

2007-09-26 Thread Olivier Sannier
Wilfried Mestdagh wrote: > Hello Olivier, > > >> The NotifyDataAvailable sets a flag in an object associated to the >> client socket that will then read the available bytes. But it will not >> do so immediately >> > > That's the problem. You have to read "all" available data "In" the > OnDa

Re: [twsocket] Newbie question : Working with Long strings

2007-09-26 Thread Clément Doss
Hello Wilfried, Thanks for helping me! > Hello Clément, > > >> I searched some examples, but most of them use LineMode and LineLimit. I'm >> afraid >> that's not an option. >> > > Wy is that not an option ? What is the problem with it ? Just terminate > your data with a charcter that cann

Re: [twsocket] 100% CPU usage if data is not processed immediately

2007-09-26 Thread Wilfried Mestdagh
Hello Olivier, > The NotifyDataAvailable sets a flag in an object associated to the > client socket that will then read the available bytes. But it will not > do so immediately That's the problem. You have to read "all" available data "In" the OnDataAvailable event. If you do not then OnDataAvail

[twsocket] 100% CPU usage if data is not processed immediately

2007-09-26 Thread Olivier Sannier
Hi, I'm using TWSocketS with a custom TWSocket derived class called TMyClientSocket to implement a TCP/IP server. I have overridden TriggerDataAvailable in TMyClientSocket in such a way: function TROAsyncSuperTcpServerSocketClient.TriggerDataAvailable( Error: Word): Boolean; begin inherited

Re: [twsocket] newb using TWSocket for the first time

2007-09-26 Thread Wilfried Mestdagh
Hello David, Eventually you can check with SocketSpy what exacly is sent. --- Rgds, Wilfried [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html http://www.mestdagh.biz -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/

Re: [twsocket] newb using TWSocket for the first time

2007-09-26 Thread David Perkins
Thanks Wilfried The app uses a main form with some buttons for the user to log in and send packets, but there is no additional message pumping going on. It only happens on one particular packet type they send so I'm hoping it's them On 26/09/2007, Wilfried Mestdagh <[EMAIL PROTECTED]> wrote: >

Re: [twsocket] newb using TWSocket for the first time

2007-09-26 Thread Wilfried Mestdagh
Hello David, > On a certain XML packet/event I'm getting duplicates (x3). It may > well be that they are sending the same packet multiple times but I > wondered if it's anything I am doing that could cause this? Something that can cause this (and other strange behaviour) is if you call direct or

[twsocket] newb using TWSocket for the first time

2007-09-26 Thread David Perkins
Hello I am trying to use TWSocket to talk to a third-party server app that will send smallish XML messages back and forth. I'm using LineMode with LineEnd = "\n" and have set Multithreaded to true. I read the packets in the OnDataAvailable event where I use a 10kb buffer which I zero before rea