Re: [twsocket] Sending directly, not via Send Buffer

2006-02-21 Thread Wilfried Mestdagh
Hello Widita, Those access violations never happened when LineMode is false... Does anyone know the solution for this problem? LineMode True or False has on itself nothing to do with AV. So on base on this information nobody can give solution. There is something wrong with your code but

Re: [twsocket] Sending directly, not via Send Buffer

2006-02-21 Thread Piotr Dałek
Hello! Yes, I'm going to use such long delimiter because I need to send binary data... If you're sending binary data, don't play with delimiters, but send the data size first (as a 4-byte longint), then actual data. Client first waits for data size, then waits for the data_size bytes and

Re: [twsocket] Sending directly, not via Send Buffer

2006-02-20 Thread Francois Piette
WSocket will always trigger exactly one OnDataAvailable per line received. Is this completely true. I'm sure in the past I've had a receive call return multiple lines, something like This is one line'#13#10'this is the next'#13#10'. And I had to split multiple lines, and process

Re: [twsocket] Sending directly, not via Send Buffer

2006-02-20 Thread Surabaya
so I can't call application.processmessages at all? what can I call if I need my user interface updated? for example I changed a Label's caption and need it refreshed when accepting data? On 2/20/06, Wilfried Mestdagh [EMAIL PROTECTED] wrote: Hello Arno, what is message pump? For

Re: [twsocket] Sending directly, not via Send Buffer

2006-02-20 Thread Francois Piette
so I can't call application.processmessages at all? Sure you can, but not from an event handler or you'll have problem reentering events. You have the same problem with a simple button: in the button OnClick, program a loop calling ProcessMessage during 30 seconds. You'll see that during this

Re: [twsocket] Sending directly, not via Send Buffer

2006-02-20 Thread Surabaya
Wow, my application really works much better after deleting all application processmessages on my code... On 2/20/06, Francois Piette [EMAIL PROTECTED] wrote: so I can't call application.processmessages at all? Sure you can, but not from an event handler or you'll have problem reentering

Re: [twsocket] Sending directly, not via Send Buffer

2006-02-20 Thread Francois Piette
I want to ask about line mode again, You're welcome :-) Is it right that in Line mode: - DataAvailable will only be called when the data received contains delimiter. Right. - DataAvailable could be called containing more than one line at a time, we must splitting each line

Re: [twsocket] Sending directly, not via Send Buffer

2006-02-20 Thread Widita Nugraha
On 2/20/06, Wilfried Mestdagh [EMAIL PROTECTED] wrote: Hello Surabaya, - If I send 1222bytes 5 times consecutively (delimited by #13#10#10#13#11#11#13#10#10#13) I'm not sure if this has ever been tested by such long delimiter string. Wy such long delimiter ? Normally you need only

Re: [twsocket] Sending directly, not via Send Buffer

2006-02-20 Thread Widita Nugraha
OK, thanks for your support, I'll try to edit my codes I'll keep you informed about my results.. Regards, Widita On 2/20/06, Francois Piette [EMAIL PROTECTED] wrote: I want to ask about line mode again, You're welcome :-) Is it right that in Line mode: - DataAvailable will

Re: [twsocket] Sending directly, not via Send Buffer

2006-02-20 Thread Wilfried Mestdagh
Hello Widita, Yes, I'm going to use such long delimiter because I need to send binary data... But your protcol will fail if this string is in the binary data you send. Dont tell me the chance is low. Think on Murphy's law: if it is possible then it will happen. --- Rgds, Wilfried [TeamICS]

Re: [twsocket] Sending directly, not via Send Buffer

2006-02-20 Thread Dod
Hello Wilfried, But you also could create a delimiter #00#00 and search if exists in you data, then try #00#01 ... then #00#02 and if you reach #FF#FF add a third delimiter #00#00#00, #00#00#01, #00#00#02 ... until you finally found a delimiter that do not exists. Of course this is not a really

Re: [twsocket] Sending directly, not via Send Buffer

2006-02-20 Thread Widita Nugraha
Hello, somebody, help me... after changing my application to line mode (binary send using line mode, using 4 bytes of unique delimiter) my application keeps giving me Access Violation Message 0x00406645:write of addess 0x00030e4c' or 0x77d4cd7f: write of address 0x00030ffc or EAccesViolation

Re: [twsocket] Sending directly, not via Send Buffer

2006-02-20 Thread Francois Piette
Hello, somebody, help me... after changing my application to line mode (binary send using line mode, using 4 bytes of unique delimiter) my application keeps giving me Access Violation Message 0x00406645:write of addess 0x00030e4c' or 0x77d4cd7f: write of address 0x00030ffc or

[twsocket] Sending directly, not via Send Buffer

2006-02-19 Thread Surabaya
Can I send directly everytime I call the client.Send(@sf, sizeof(sf))? Does TWSocketServer have any property that allow me to send everything without buffered first? regards, Widita -- To unsubscribe or change your settings for TWSocket mailing list please goto

Re: [twsocket] Sending directly, not via Send Buffer

2006-02-19 Thread Surabaya
On 2/19/06, Francois PIETTE [EMAIL PROTECTED] wrote: Can I send directly everytime I call the client.Send(@sf, sizeof(sf))? Yes, but pay attention to dynamic data which is represented by pointers. Sending a pointer to a remote site is useless ! Dynamic data are long strings, objects,

Re: [twsocket] Sending directly, not via Send Buffer

2006-02-19 Thread Francois PIETTE
to send everything without buffered first? What do you mean by buffering first ? It's something like this, when I send 2 packets consecutively, 1 after another, it often received as one packet in the client side (WSocket1DataAvailable event)... This is how TCP stream is operating. In

Re: [twsocket] Sending directly, not via Send Buffer

2006-02-19 Thread Surabaya
On 2/19/06, Francois PIETTE [EMAIL PROTECTED] wrote: to send everything without buffered first? What do you mean by buffering first ? It's something like this, when I send 2 packets consecutively, 1 after another, it often received as one packet in the client side

Re: [twsocket] Sending directly, not via Send Buffer

2006-02-19 Thread Francois PIETTE
Ok, then I must manage the received buffer by myself? cutting and joining so that it can be interpreted perfectly by the receiver, is that right? Yes and no :-) TWSocket has a line mode in which it assemble (or split) packets for you. You specify a delimiter (default to #13#10 but can be

Re: [twsocket] Sending directly, not via Send Buffer

2006-02-19 Thread Surabaya
On 2/19/06, Francois PIETTE [EMAIL PROTECTED] wrote: Ok, then I must manage the received buffer by myself? cutting and joining so that it can be interpreted perfectly by the receiver, is that right? Yes and no :-) TWSocket has a line mode in which it assemble (or split) packets for

Re: [twsocket] Sending directly, not via Send Buffer

2006-02-19 Thread Dod
Hello Surabaya, if you send binary with LineMode there are many way to manage it. The simplest : use BASE64 e-mail attachement style that is nice as designed to work ascii lined mode but increase size of data about +40% (as all binary e-mail attachements do by the way). You could

Re: [twsocket] Sending directly, not via Send Buffer

2006-02-19 Thread Fastream Technologies
What about Mimeutils.pas in ICS package? Regards, SZ - Original Message - From: Surabaya [EMAIL PROTECTED] To: ICS support mailing twsocket@elists.org Sent: Sunday, February 19, 2006 7:42 PM Subject: Re: [twsocket] Sending directly, not via Send Buffer OK, I'll try the Base64 method

Re: [twsocket] Sending directly, not via Send Buffer

2006-02-19 Thread Francois Piette
Yes, right now I am facing the same problem as Dan's I'm receiving more than one line in a call of DataAvailable does TWSocket has any property to set so that there will only be a line per DataAvailable event triggered? Set : WSocket1.LineMode := TRUE; WSocket1.LineEnd := #13#10;