Re: [twsocket] TWSocket Digest, Vol 746, Issue 3

2018-07-12 Thread Mark Moss
Cl?ment


How about telling us what the invalid parameter was?


Mark Moss
USA

***

Message: 8
Date: Thu, 12 Jul 2018 14:17:27 -0300
From: Cl?ment Doss 
To: twsocket@lists.elists.org
Subject: Re: [twsocket] Idle Socket is closed even with KeepAlive
under windows
Message-ID: 
Content-Type: text/plain; charset=utf-8; format=flowed

Hello!

I finally found the issue! Of course it was on my side. An invalid 
parameter was resetting the idle connection "by design". I just bypassed 
that parameter and the communication is working flawlessly!

Thanks for your help!
Cl?ment

*

-- 
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] TWSocket Digest, Vol 727, Issue 2

2018-01-30 Thread A.S.

Everything's done years ago!

Add BUILTIN_TIMEOUT define to project options and use members of 
TCustomTimeoutWSocket class.


You'll get an OnTimeout event that is called with the reason (more 
precisely saying, socket state) as parameter. It's up to you to handle 
this event.


Btw, if you need some additional periodical things, use TIcsThreadTimer 
which is designed to be scalable to thousands of timers.



30.01.2018 15:00, twsocket-requ...@lists.elists.org пишет:

Message: 4
Date: Tue, 30 Jan 2018 05:26:45 + (UTC)
From: Allan Fernandes <allan_fernan...@yahoo.co.uk>
To: "twsocket@lists.elists.org" <twsocket@lists.elists.org>
Subject: [twsocket] TWSocket Timeout Property ?
Message-ID: <334596969.3389904.1517290005...@mail.yahoo.com>
Content-Type: text/plain; charset=UTF-8

Hi,
If I try to connect my TWSocket and there is no socket listening on the other 
end then the TWSocket's state goes into wsConnecting for a long time. I want to 
reduce that Timeout. Which property should I use ?
RegardsAllan




--
A.S.

--
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] TWSocket Timeout Property ?

2018-01-29 Thread Wilfried Mestdagh

Hi,

I use a TTimer for timeouts.

Met vriendelijke groeten,
Wilfried Mestdagh

Op 30-01-18 om 06:26 schreef Allan Fernandes:

Hi,
If I try to connect my TWSocket and there is no socket listening on the other 
end then the TWSocket's state goes into wsConnecting for a long time. I want to 
reduce that Timeout. Which property should I use ?
RegardsAllan


--
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] TWSocket Timeout Property ?

2018-01-29 Thread Allan Fernandes
Hi,
If I try to connect my TWSocket and there is no socket listening on the other 
end then the TWSocket's state goes into wsConnecting for a long time. I want to 
reduce that Timeout. Which property should I use ?
RegardsAllan
-- 
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] Twsocket Problem over Internet.

2017-11-17 Thread François Piette
Not correct.

Please narow your question. Make it more specific. Describe your "problem".
Try to apply the advice we gave to you in previous answers.
Have you read the two article link I gave to you a few days ago ?
We will not write the code for you.

Regards,

--
francois.pie...@overbyte.be
The author of the freeware multi-tier middleware MidWare
The author of the freeware Internet Component Suite (ICS)
http://www.overbyte.be


-Message d'origine-
De : TWSocket [mailto:twsocket-boun...@lists.elists.org] De la part de
Fatimire
Envoyé : lundi 13 novembre 2017 21:31
À : ICS support mailing
Objet : Re: [twsocket] Twsocket Problem over Internet.

anything is wrong ?
thank you everybody.

Receiving...
var
Count : Integer;
InString: string;
begin
with Sender as TClient do
try
if IsRcvBin then
begin
if not assigned(MS) then
  MS := TMemoryStream.Create;
Count := Receive(@Buffer[1], BLOCK_SIZE);

if Count <= 0 then //check if we received something
Exit;
// write the buffer to our memorystream
MS.Write(Buffer, Count);
if MS.Size = ExpectedStreamSize then
//have we received whole stream
Image2.Picture.Graphic.LoadFromStream(MS);
Exit;
end;

InString := ReceiveStr;
if (InString.StartsWith('IMAGE:')) then
InString := InString.Substring(6);

ExpectedStreamSize := StrToInt(InString);
IsRcvBin := True;// we start receiving binary
data
LineMode := False;   // so we put linemode off
 except  end;
end;



-- 
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] TWSocket...

2017-11-14 Thread Angus Robertson - Magenta Systems Ltd
> >That is 25 versions old, lines move.  What function? 
> function TCustomWSocket.GetPeerAddr: String;

Thanks, literal corrected. 

Angus

-- 
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] TWSocket...

2017-11-14 Thread zayin
Thanks Angus.

>That is 25 versions old, lines move.  What function? 

function TCustomWSocket.GetPeerAddr: String;



-- 
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] Twsocket Problem over Internet.

2017-11-14 Thread Angus Robertson - Magenta Systems Ltd
> anything is wrong ?

Do you mean your code does not work correctly.  

We have made various suggestions about how it should be written to work
correctly, but you have yet to implement any of them.

Angus

-- 
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] TWSocket...

2017-11-14 Thread Angus Robertson - Magenta Systems Ltd
> If I call TWSocket .Connect and Windows times out (about 25 
> seconds), I get the TWSocket .SessionClosed callback. How do I
> determine it was a timeout and not just a normal close? 

The onSessionConnected event is always called after Connect, with an
Error number.  If not zero, connection failed.   

onSessionConnected will be called before onSessionClosed, but the
latter does not know if the connection was OK or failed. 

> Line 8249, Version 8.26

That is 25 versions old, lines move.  What function? 

Angus

-- 
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] Twsocket Problem over Internet.

2017-11-13 Thread Fatimire
anything is wrong ?
thank you everybody.

Receiving...
var
Count : Integer;
InString: string;
begin
with Sender as TClient do
try
if IsRcvBin then
begin
if not assigned(MS) then
  MS := TMemoryStream.Create;
Count := Receive(@Buffer[1], BLOCK_SIZE);

if Count <= 0 then //check if we received something
Exit;
// write the buffer to our memorystream
MS.Write(Buffer, Count);
if MS.Size = ExpectedStreamSize then
//have we received whole stream
Image2.Picture.Graphic.LoadFromStream(MS);
Exit;
end;

InString := ReceiveStr;
if (InString.StartsWith('IMAGE:')) then
InString := InString.Substring(6);

ExpectedStreamSize := StrToInt(InString);
IsRcvBin := True;// we start receiving binary data
LineMode := False;   // so we put linemode off
 except  end;
end;

Sent from [ProtonMail](https://protonmail.ch), encrypted email based in 
Switzerland.

>  Original Message 
> Subject: Re: [twsocket] Twsocket Problem over Internet.
> Local Time: November 13, 2017 11:48 AM
> UTC Time: November 13, 2017 1:48 PM
> From: wilfr...@mestdagh.biz
> To: twsoc...@elists.org
>
> If you set the Addr property to '0.0.0.0' then TWSocket will listen on
> all interfaces.
>
> Met vriendelijke groeten,
> Wilfried Mestdagh
>
> Op 13-11-17 om 14:43 schreef Fatimire:
>
>> How i listen the wsocket to all interfaces? maybe my problem is this i have 
>> multiple interfaces.
>> --
>> 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] Twsocket Problem over Internet.

2017-11-13 Thread Wilfried Mestdagh
If you set the Addr property to '0.0.0.0' then TWSocket will listen on 
all interfaces.


Met vriendelijke groeten,
Wilfried Mestdagh

Op 13-11-17 om 14:43 schreef Fatimire:

How i listen the wsocket to all interfaces? maybe my problem is this i have 
multiple interfaces.

--
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] Twsocket Problem over Internet.

2017-11-13 Thread Fatimire
How i listen the wsocket to all interfaces? maybe my problem is this i have 
multiple interfaces.

Sent from [ProtonMail](https://protonmail.ch), encrypted email based in 
Switzerland.

>  Original Message 
> Subject: Re: [twsocket] Twsocket Problem over Internet.
> Local Time: November 13, 2017 11:28 AM
> UTC Time: November 13, 2017 1:28 PM
> From: fatim...@protonmail.com
> To: ICS support mailing <twsocket@lists.elists.org>
>
> i dont why works on local network and not work in internet connection...
>
> Sent from [ProtonMail](https://protonmail.ch), encrypted email based in 
> Switzerland.
>
>>  Original Message 
>> Subject: Re: [twsocket] Twsocket Problem over Internet.
>> Local Time: November 11, 2017 9:01 AM
>> UTC Time: November 11, 2017 11:01 AM
>> From: francois.pie...@skynet.be
>> To: 'ICS support mailing' <twsocket@lists.elists.org>
>>
>>> Your receiving is also likely to fail, LineMode should not be used when
>>> you expect binary data,
>>>
>>> Agreed.
>>>
>>> and makes a program more complex than necessary swapping back and forward
>>> while receiving, checking line end is not very hard.
>>>
>>> Disagreed.
>>> What would be easier for Fatimire is to send the image length a single
>>> integer (4 bytes is probably enough) instead of a text line. It is easier
>>> because the length is fixed. When receiving, it is enough to check if the
>>> first 4 bytes are received and the get the length without further parsing.
>>>
>>> The code should be written using pure event driven, without wait loops.
>>>
>>> Fatimire should read the following documentation:
>>> http://wiki.overbyte.eu/wiki/index.php/Asynchronous_Paradigm
>>> http://wiki.overbyte.eu/wiki/index.php/Sending_and_receiving_data
>>>
>>> --
>>> francois.pie...@overbyte.be
>>> The author of the freeware multi-tier middleware MidWare
>>> The author of the freeware Internet Component Suite (ICS)
>>> 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] Twsocket Problem over Internet.

2017-11-13 Thread Fatimire
i dont why works on local network and not work in internet connection...

Sent from [ProtonMail](https://protonmail.ch), encrypted email based in 
Switzerland.

>  Original Message 
> Subject: Re: [twsocket] Twsocket Problem over Internet.
> Local Time: November 11, 2017 9:01 AM
> UTC Time: November 11, 2017 11:01 AM
> From: francois.pie...@skynet.be
> To: 'ICS support mailing' <twsocket@lists.elists.org>
>
>> Your receiving is also likely to fail, LineMode should not be used when
>> you expect binary data,
>>
>> Agreed.
>>
>> and makes a program more complex than necessary swapping back and forward
>> while receiving, checking line end is not very hard.
>>
>> Disagreed.
>> What would be easier for Fatimire is to send the image length a single
>> integer (4 bytes is probably enough) instead of a text line. It is easier
>> because the length is fixed. When receiving, it is enough to check if the
>> first 4 bytes are received and the get the length without further parsing.
>>
>> The code should be written using pure event driven, without wait loops.
>>
>> Fatimire should read the following documentation:
>> http://wiki.overbyte.eu/wiki/index.php/Asynchronous_Paradigm
>> http://wiki.overbyte.eu/wiki/index.php/Sending_and_receiving_data
>>
>> --
>> francois.pie...@overbyte.be
>> The author of the freeware multi-tier middleware MidWare
>> The author of the freeware Internet Component Suite (ICS)
>> 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] Twsocket Problem over Internet.

2017-11-11 Thread François Piette
> Your receiving is also likely to fail, LineMode should not be used when
you expect binary data, 

Agreed.

> and makes a program more complex than necessary swapping back and forward
while receiving, checking line end is not very hard. 

Disagreed.
What would be easier for Fatimire is to send the image length a single
integer (4 bytes is probably enough) instead of a text line. It is easier
because the length is fixed. When receiving, it is enough to check if the
first 4 bytes are received and the get the length without further parsing.

The code should be written using pure event driven, without wait loops.

Fatimire should read the following documentation:
 http://wiki.overbyte.eu/wiki/index.php/Asynchronous_Paradigm
 http://wiki.overbyte.eu/wiki/index.php/Sending_and_receiving_data


--
francois.pie...@overbyte.be
The author of the freeware multi-tier middleware MidWare
The author of the freeware Internet Component Suite (ICS)
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] Twsocket Problem over Internet.

2017-11-11 Thread Angus Robertson - Magenta Systems Ltd
> I try send by block and have the same problem.
> Sleep(100);

If you changed that to Sleep(5000) it would probably work, but very
slowly   

As I said originally, you should be using the OnDataSent to determine
when the data is sent successfully, not just waiting and assuming the
internet is working perfectly and instantly. 

Your receiving is also likely to fail, LineMode should not be used when
you expect binary data, and makes a program more complex than necessary
swapping back and forward while receiving, checking line end is not
very hard. 

And you need to loop to keep receiving until the whole image has been
arrived, it might take minutes on a slow connection.  And handle the
connection breaking before it's complete. 

Angus



-- 
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] Twsocket Problem over Internet.

2017-11-11 Thread François Piette
Hi !

Sending is OK although not optimal because of buffering.  At least, be sure
to no close the socket before the sending is done: TWSocket will buffer data
for you (up to the amount of available ram space). It is bette as Angus
said, to send by blocks.

For receiving, you must first receive the line you send before the image, to
get the image size. And then you must receive block by block until you get
the whole image.

You may switch TWSoket from line mode (for the line you sent with the image
size) and the go back to binary mode to receive the rest block by block as
you do.

--
francois.pie...@overbyte.be
The author of the freeware multi-tier middleware MidWare
The author of the freeware Internet Component Suite (ICS)
http://www.overbyte.be




-Message d'origine-
De : TWSocket [mailto:twsocket-boun...@lists.elists.org] De la part de
Fatimire
Envoyé : vendredi 10 novembre 2017 20:32
À : ICS support mailing
Objet : [twsocket] Twsocket Problem over Internet.

HI for all, i do a prototype to transfer a imagem overt internet with
Twsocket, but in local network works fine, but when i test with a remote
computer in internet connection the file is sended but dont receive or
receive a image with lost collor.

sending ...
try
  FMS.Seek(0, soBeginning);
  Form10.wscktsrvr1.Client[0].SendStr('IMAGE:' + IntToStr(FMS.Size) +
sLineBreak);
  Form10.wscktsrvr1.Client[0].Send(FMS.Memory, FMS.Size);
finally
Receiving ...
if (FIsBiniary) then begin
iCount := Socket3.Receive(FRcvd + FWritePtr, FFileSize - FWritePtr);
Inc(FWritePtr, iCount);

if (iCount = 0) then begin
  FIsBiniary := False;
end;
if FWritePtr = FFileSize then begin
  F := TMemoryStream.Create();
  try
F.Write(FRcvd[0], FFileSize);
Memo1.Lines.Add('write');
  finally
oBMP := TBitmap.Create;
f.Seek(0, soBeginning);
oBMP.LoadFromStream(F);
Image1.Picture.Assign(oBMP);
FreeMem(FRcvd, FFileSize);
FreeAndNil(oBMP);
F.Free;
  end;

  FIsBiniary := False;
  Socket3.LineMode := True;
end;
Exit;
  end;

  sRcvBuf := Socket3.ReceiveStr.Trim;
  Memo1.Lines.Add(sRcvBuf);

  if (sRcvBuf.StartsWith('IMAGE001:')) then begin
sRcvBuf := sRcvBuf.Substring(9);
Memo1.Lines.Add('Size: '  + sRcvBuf);

FFileSize := StrToIntDef(sRcvBuf, 0);
FWritePtr := 0;
GetMem(FRcvd, FFileSize);
Socket3.LineMode := False;
FIsBiniary := True;
  end;
end;

someone can help-me ?

Sent from [ProtonMail](https://protonmail.ch), encrypted email based in
Switzerland.
--
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] Twsocket Problem over Internet.

2017-11-10 Thread Angus Robertson - Magenta Systems Ltd
> HI for all, i do a prototype to transfer a imagem overt internet 
> with Twsocket,
> but in local network works fine, but when i test with a remote 
> computer in internet connection
> the file is sended but dont receive or receive a image with lost 
> collor.

Your code assumes that Send() will cope with an unlimited amount of
data, when there are limits due to the internal buffers.

For large sizes, say over 32K, you need to send the data in blocks,
waiting until each has been sent, before sending the next.  This is
illustrated in several sample applications, with each new block being
sent when the OnDataSent event is called.

Angus

-- 
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] Twsocket Problem over Internet.

2017-11-10 Thread Fatimire
HI for all, i do a prototype to transfer a imagem overt internet with Twsocket,
but in local network works fine, but when i test with a remote computer in 
internet connection
the file is sended but dont receive or receive a image with lost collor.

sending ...
try
  FMS.Seek(0, soBeginning);
  Form10.wscktsrvr1.Client[0].SendStr('IMAGE:' + IntToStr(FMS.Size) + 
sLineBreak);
  Form10.wscktsrvr1.Client[0].Send(FMS.Memory, FMS.Size);
finally
Receiving ...
if (FIsBiniary) then begin
iCount := Socket3.Receive(FRcvd + FWritePtr, FFileSize - FWritePtr);
Inc(FWritePtr, iCount);

if (iCount = 0) then begin
  FIsBiniary := False;
end;
if FWritePtr = FFileSize then begin
  F := TMemoryStream.Create();
  try
F.Write(FRcvd[0], FFileSize);
Memo1.Lines.Add('write');
  finally
oBMP := TBitmap.Create;
f.Seek(0, soBeginning);
oBMP.LoadFromStream(F);
Image1.Picture.Assign(oBMP);
FreeMem(FRcvd, FFileSize);
FreeAndNil(oBMP);
F.Free;
  end;

  FIsBiniary := False;
  Socket3.LineMode := True;
end;
Exit;
  end;

  sRcvBuf := Socket3.ReceiveStr.Trim;
  Memo1.Lines.Add(sRcvBuf);

  if (sRcvBuf.StartsWith('IMAGE001:')) then begin
sRcvBuf := sRcvBuf.Substring(9);
Memo1.Lines.Add('Size: '  + sRcvBuf);

FFileSize := StrToIntDef(sRcvBuf, 0);
FWritePtr := 0;
GetMem(FRcvd, FFileSize);
Socket3.LineMode := False;
FIsBiniary := True;
  end;
end;

someone can help-me ?

Sent from [ProtonMail](https://protonmail.ch), encrypted email based in 
Switzerland.
-- 
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] TWSocket Digest, Vol 701, Issue 2

2017-06-28 Thread Mark Moss
Florian


I would like to suggest that you Upgrade from Delphi 7 to Delphi
2007 as this is the last non-unicode version of Delphi.

I have done more than 100 upgrades all the way from software that
was written in Delphi 3 to Delphi 2007 and not encountered any major
problems in doing so.  Just the normal changes in the components due to
added / deleted features.

I find that Delphi 2007 to be even more stable than Delphi 7 and has
many features that it does not have.

Mark Moss

P.S. - Angus - Please keep up the good work and know that we do
appreciate it.


-Original Message-
From: TWSocket [mailto:twsocket-boun...@lists.elists.org] On Behalf Of
twsocket-requ...@lists.elists.org
Sent: Wednesday, June 28, 2017 5:00 AM
To: twsocket@lists.elists.org
Subject: TWSocket Digest, Vol 701, Issue 2

Send TWSocket mailing list submissions to
twsocket@lists.elists.org

To subscribe or unsubscribe via the World Wide Web, visit
http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
or, via email, send a message with subject or body 'help' to
twsocket-requ...@lists.elists.org

You can reach the person managing the list at
twsocket-ow...@lists.elists.org

When replying, please edit your Subject line so it is more specific than
"Re: Contents of TWSocket digest..."


Today's Topics:

   1. Re: Aborting PUT (Angus Robertson - Magenta Systems Ltd)
   2. Re: FTP file download done (Florian Hector)
   3. Re: FTP file download done (Angus Robertson - Magenta Systems Ltd)
   4. Re: FTP file download done (Florian Hector)


--

Message: 1
Date: Tue, 27 Jun 2017 13:13 +0100 (BST)
From: "Angus Robertson - Magenta Systems Ltd" 
To: twsocket@lists.elists.org
Subject: Re: [twsocket] Aborting PUT
Message-ID: 
Content-Type: text/plain; charset="iso-8859-1"

> Only remaining is the Resume option. Thanks for the suggestion.
> Question: With TFtpClient to Resume transfer do I have to know the 
> remote file size ?

You only have to know the position from which you want to resume, ie the
size of the file partially downloaded.  

But unless you know the expected size, you won't know whether you need to
resume.  You can get into a loop if you resume a file from the end.


You'll see a lot of checks in TMagFtp and they are necessary, if you want
robust downloads.  TMagFtp does use sync methods, but there is a threaded
version which I've tested with a few hundred simultaneous FTP sessions.  So
I've never seen a reason to rewrite something already solid as async and
debug and test it all again.  

Angus



--

Message: 2
Date: Tue, 27 Jun 2017 17:53:55 +0200
From: Florian Hector 
To: twsocket@lists.elists.org
Subject: Re: [twsocket] FTP file download done
Message-ID: <029882ce-ed1b-10af-132e-3521ba40f...@web.de>
Content-Type: text/plain; charset=utf-8


> ICS has two functions UpdateFileAge and UpdateUFileAge in 
> OverbyteIcsFtpSrvT.pas to set the time stamp to local or UTC time 
> respectively.
>
> Of course you need the correct time stamp to start with, which depends 
> on the FTP server capabilities, some are better than others.  UTC is 
> safer since it does not change twice a year.
>  
Angus,

UpdateFileAge and UpdateUFileAge seem to be for the server side, what I need
is to set the file age of the downloaded file.

Florian


--

Message: 3
Date: Tue, 27 Jun 2017 17:16 +0100 (BST)
From: "Angus Robertson - Magenta Systems Ltd" 
To: twsocket@lists.elists.org
Subject: Re: [twsocket] FTP file download done
Message-ID: 
Content-Type: text/plain; charset="iso-8859-1"

> UpdateFileAge and UpdateUFileAge seem to be for the server side, what 
> I need is to set the file age of the downloaded file.

They work fine in TMagFtp which is an FTP client.  

Angus



--

Message: 4
Date: Tue, 27 Jun 2017 18:23:38 +0200
From: Florian Hector 
To: twsocket@lists.elists.org
Subject: Re: [twsocket] FTP file download done
Message-ID: <2a112015-68c4-6a44-3ea5-39c4d76e8...@web.de>
Content-Type: text/plain; charset=utf-8

Am 27.06.2017 um 18:16 schrieb Angus Robertson - Magenta Systems Ltd:
>> UpdateFileAge and UpdateUFileAge seem to be for the server side, what 
>> I need is to set the file age of the downloaded file.
> They work fine in TMagFtp which is an FTP client.  
>
> Angus
>
I'd love to use TMagFtp with all the goodies  it has to offer, unfortunately
I can't get my D7 to install the components, so I'm stuck with what ICS has
to offer for the time being.

I have to upgrade eventually, but not anytime soon.

Florian



--

Subject: Digest Footer

___
To unsubscribe or change your settings 

Re: [twsocket] TWSocket Digest, Vol 696, Issue 2

2017-05-27 Thread Mark Moss
Angus


http://wiki.overbyte.eu/ would not work for me thru IE or Chrome or
Firefox 

HOWEVER

http://wiki.overbyte.eu/wiki/ works on all three.


Mark Moss
USA

-- 
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] TWSocket Digest, Vol 691, Issue 2

2017-04-19 Thread Mark Moss
Angus


I would go for the New State of 'wsDnsLookup'.


Mark Moss



-- 
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] Twsocket OSX

2017-01-10 Thread Brian Hamilton

HI

I use the great ICS
and have had great success with twoscket  now, on windows,I can listen for a 
connection and accept that connection (session available) but the same code on 
a mac (OSX), using delphi, the session is avaialble is never reached
is there something I can change/need to change, etc?
thanks!

--
Brian Hamilton
http://www.weather-display.com

--
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] TWsocket transfer TmemoryStream

2016-12-06 Thread François Piette
> Always is needed use the OnDataSent event ?
> I need only transfer the tmemorystream off a Timage1 to Timage2 over
twsocket.

You may send a huge block of data in one Send call. An entire image if you
like. BUT remember TWSocket is asynchronous and transmitting data over the
network takes time. You call to the Send method will return almost
instantly, way long before the data is actually sent: TWSocket will
automatically buffer the data in memory and send it in the background for
you. This may take a lot of memory if you send large data. This may be of no
importance for your application, or it IS important...

When using OnDataSent event, you have control on the size of data that is
memorized. For example you can read your stream 4KB (Any value is OK) at a
time, send that chunk of data and then read the next chunk from the
OnDataSent event, that is the next chunk will be read and put in internal
TWSocket buffer only when previous chunk is sent. This is how the HTTP
component (both client and server) are working to send data. This way it
doesn't matters if a multi GB file is sent. The memory used is always the
size of the chunk your application read.


--
francois.pie...@overbyte.be
The author of the freeware multi-tier middleware MidWare
The author of the freeware Internet Component Suite (ICS)
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] TWsocket transfer TmemoryStream

2016-12-06 Thread Angus Robertson - Magenta Systems Ltd
> Always is needed use the OnDataSent event ?
> I need only transfer the tmemorystream off a Timage1 to Timage2 
> over twsocket.

It will probably work on a LAN, as long as BLOCK_SIZE is no more than
64 KBytes, and the server accepts the data immediately it's sent.  

But the proper way is to send chunks in OnDataSent, then you know the
other end is accepting the data.  

The sample OverbyteIcsSender.dpr illustrates how to use OnDataSent to
send the next block.  

Or you could just use my ICS TMagIpLog component, that will send and
receive a stream. 

https://www.magsys.co.uk/delphi/magics.asp

That component also uses OnDataSent to send a stream, if you want to
borrow the code, but using the proper component would be faster. 

Angus

-- 
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] TWsocket transfer TmemoryStream

2016-12-05 Thread Fatimire
Always is needed use the OnDataSent event ?
I need only transfer the tmemorystream off a Timage1 to Timage2 over twsocket.



Sent from [ProtonMail](https://protonmail.ch), encrypted email based in 
Switzerland.



 Original Message 
Subject: Re: [twsocket] TWsocket transfer TmemoryStream
Local Time: 5 de Dezembro de 2016 5:31 PM
UTC Time: 5 de Dezembro de 2016 19:31
From: fatim...@protonmail.com
To: ICS support mailing <twsocket@lists.elists.org>

procedure TForm1.SendClick(Sender: TObject);
var
Buffer: array [1..BLOCK_SIZE] of char;
Count: Integer;
MemoryStream : TMemoryStream;
begin
try
MemoryStream := TMemoryStream.Create;
img1.Picture.Graphic.SaveToStream(MemoryStream);
MemoryStream.Seek(0, soFromBeginning);
WSocketServer1.Client[0].SendStr(IntToStr(MemoryStream.Size) + #13#10);

Count := MemoryStream.Read(Buffer[1], BLOCK_SIZE);
if Count > 0 then
WSocketServer1.Client[0].Send(@Buffer[1], Count);
if Count < BLOCK_SIZE then ShowMessage('Sended');
except end;

end;

Its Ok ?


Sent from [ProtonMail](https://protonmail.ch), encrypted email based in 
Switzerland.



 Original Message 
Subject: Re: [twsocket] TWsocket transfer TmemoryStream
Local Time: 5 de Dezembro de 2016 3:19 PM
UTC Time: 5 de Dezembro de 2016 17:19
From: an...@magsys.co.uk
To: twsocket@lists.elists.org

> I need help to send text and stream in same socket

Sending text and stream data is simple, just use Send, although if your
stream is larger than a few kilobytes you need to send it in chunks,
check whether it's been sent, then send the next chunk.

This is how the HTTP client component works.

Receiving mixed text and stream data is much harder, because you don't
generally know where one stops and the other starts. So you design a
protocol, an example being HTTP again, where a blank line says text
stops and stream starts, the stream length being content-length long or
when the socket closes.

Angus

--
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] TWsocket transfer TmemoryStream

2016-12-05 Thread Fatimire
procedure TForm1.SendClick(Sender: TObject);
var
Buffer: array [1..BLOCK_SIZE] of char;
Count: Integer;
MemoryStream : TMemoryStream;
begin
try
MemoryStream := TMemoryStream.Create;
img1.Picture.Graphic.SaveToStream(MemoryStream);
MemoryStream.Seek(0, soFromBeginning);
WSocketServer1.Client[0].SendStr(IntToStr(MemoryStream.Size) + #13#10);

Count := MemoryStream.Read(Buffer[1], BLOCK_SIZE);
if Count > 0 then
WSocketServer1.Client[0].Send(@Buffer[1], Count);
if Count < BLOCK_SIZE then ShowMessage('Sended');
except end;
end;

Its Ok ?


Sent from [ProtonMail](https://protonmail.ch), encrypted email based in 
Switzerland.



 Original Message 
Subject: Re: [twsocket] TWsocket transfer TmemoryStream
Local Time: 5 de Dezembro de 2016 3:19 PM
UTC Time: 5 de Dezembro de 2016 17:19
From: an...@magsys.co.uk
To: twsocket@lists.elists.org

> I need help to send text and stream in same socket

Sending text and stream data is simple, just use Send, although if your
stream is larger than a few kilobytes you need to send it in chunks,
check whether it's been sent, then send the next chunk.

This is how the HTTP client component works.

Receiving mixed text and stream data is much harder, because you don't
generally know where one stops and the other starts. So you design a
protocol, an example being HTTP again, where a blank line says text
stops and stream starts, the stream length being content-length long or
when the socket closes.

Angus

--
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] TWsocket transfer TmemoryStream

2016-12-05 Thread Angus Robertson - Magenta Systems Ltd
> I need help to send text and stream in same socket

Sending text and stream data is simple, just use Send, although if your
stream is larger than a few kilobytes you need to send it in chunks,
check whether it's been sent, then send the next chunk.

This is how the HTTP client component works. 

Receiving mixed text and stream data is much harder, because you don't
generally know where one stops and the other starts.  So you design a
protocol, an example being HTTP again, where a blank line says text
stops and stream starts, the stream length being content-length long or
when the socket closes. 

Angus

-- 
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] TWSocket Client Timeout.

2016-12-05 Thread Moro Alexandre
Hello Everyone,

I think i found a solution...

First, i will to to explain what i understand.

How works my applications :
It connects (TWSocket) to 3 remote devices which provide data (30 chars)
every 10 seconds each.
It binds a server (TWSocketServer), about 8 clients are connected on it.

This application compute the data from the remote device, and send the
results to the 8 clients.
All the flow is based on a TTimer (apart the OnDataAvaible of the server and
data retreived from the client, they push data in a FIFO).

The problem :
After many hours (26 hours), when the clients resynchronize all the data or
a new client connects to the server, the application resend all the dat to
them :
It is done in the TTimer event.

So here, the application freeze a little time to compute and send the data
(maybe 5-20 seconds) :
A) If I a call the SendStr to send my data, everything is break :
 - Data are not sent to the clients.
 - I cannot etablish a new connection to my TWServerSocket (the connection
is refused).
 - But the remote device are not disconnected.
  - each TWSocket says "i'm always connected".
  - remote device tell the same thing.
  - Netstat confirm.

B) If i comment the SendStr, so i only compute my data, the application
freeze less time (below 10 seconds).
 - Connection to the remote device still retrieving data.
 - I can always etablish new connection to my TWSocketServer.
 - ClientCount return by TWServerSocket is fine.


The solution (or workaround !) :
I simply replace TWSocketThrdServer and TWSocketThrdClient instead of
TWSocketServer and TWSocketClient, and it seems to not break anything now
(youhou) !!!

Why ? 
I think that freezing the main thread breaks a lot of thing...
But until here (and for about 10years), everything worked fine.
For me, the "only" thing we change is that we updated from BCB6 to XE3 and
to ICS v8.16 (i mean our source code stay the same).
I will make a lot, lot of test to see the difference with the threaded
server/client.
On some application i see that they use a TAntiFreeze component maybe it can
help too, but i did not try.


@Tim Hyde :
Thanks a lot to point me to your old thread, i was thinking that the
TWSocketServer and TWSocket already implementing thread fonctionnality.
And i think you have got the solution...

@Angus
I undestand that i'm not very clear in all the description, but i'm not
English native, and i really provide you all what i have !!!
I really know that it is frustrating when someone say my program do not work
(and a most part of the time this is not the case...), 
so i understand your reponse, so i really do not want to say "ICS do not
work", but i need help with your program, so please you better know the best
practice to implement it !

So thanks for the works !


Another last "problem" :
OverbyteIcsWSocketTS.pas is not included in the CBXe3Install nor in the
CBXe3VclFmxInstall.
The compiler ask for Form.dcu or Controls.dcu depending on what i'm
compiling (i'm a really newbie for that...)


Best regards,
Moro Alexandre.


-Message d'origine-
De : TWSocket [mailto:twsocket-boun...@lists.elists.org] De la part de
François Piette
Envoyé : samedi 3 décembre 2016 17:13
À : 'ICS support mailing'
Objet : Re: [twsocket] TWSocket Client Timeout.

Hello Alexandre,

There is nothing preventing data from a TTimer event.
Are you using "sync" functions or "async" functions ? Are you using wait
loops ?

When you send data from TTimer event, is this "transparent" to the protocol
you are using ? Maybe the data send from TTimer interfere with data sent (or
received) from other parts of your program?


--
francois.pie...@overbyte.be
The author of the freeware multi-tier middleware MidWare The author of the
freeware Internet Component Suite (ICS) http://www.overbyte.be




-Message d'origine-
De : TWSocket [mailto:twsocket-boun...@lists.elists.org] De la part de Moro
Alexandre Envoyé : vendredi 2 décembre 2016 13:44 À : 'ICS support mailing'
Objet : Re: [twsocket] TWSocket Client Timeout.

Hello !

I finaly found where comes from the problem :
When the clients connects to my server, i send to everyone a lot of data
from a TTimer.

If i remove the SendStr() call, everything works fine !!!

So please,
1) Can you explain me what is wrong in calling SendStr from a TTimer ?
2) How can this call, block every differents object based on TWSocket,
server object and client object ?
3) Why there are no error event nor exception throw...

Solution :
1)
I tried to set mpWSocketServer->MultiThread = true; But it doesn't change
anything...

2)
Do i have to implement a Thread for all the SendStr be apart from the main
thread ?
I create a Thread, pass the TWSocketServer object as parameters, and a FIFO
list with event.
When i complete this list, the thread process the new data and SendStr...


I'm shocked that this call can interfere seperate object...

Thank you !

Best regards,
Moro Ale

Re: [twsocket] TWSocket Client Timeout.

2016-12-03 Thread François Piette
Hello Alexandre,

There is nothing preventing data from a TTimer event.
Are you using "sync" functions or "async" functions ? Are you using wait
loops ?

When you send data from TTimer event, is this "transparent" to the protocol
you are using ? Maybe the data send from TTimer interfere with data sent (or
received) from other parts of your program?


--
francois.pie...@overbyte.be
The author of the freeware multi-tier middleware MidWare
The author of the freeware Internet Component Suite (ICS)
http://www.overbyte.be




-Message d'origine-
De : TWSocket [mailto:twsocket-boun...@lists.elists.org] De la part de Moro
Alexandre
Envoyé : vendredi 2 décembre 2016 13:44
À : 'ICS support mailing'
Objet : Re: [twsocket] TWSocket Client Timeout.

Hello !

I finaly found where comes from the problem :
When the clients connects to my server, i send to everyone a lot of data
from a TTimer.

If i remove the SendStr() call, everything works fine !!!

So please,
1) Can you explain me what is wrong in calling SendStr from a TTimer ?
2) How can this call, block every differents object based on TWSocket,
server object and client object ?
3) Why there are no error event nor exception throw...

Solution :
1)
I tried to set mpWSocketServer->MultiThread = true; But it doesn't change
anything...

2)
Do i have to implement a Thread for all the SendStr be apart from the main
thread ?
I create a Thread, pass the TWSocketServer object as parameters, and a FIFO
list with event.
When i complete this list, the thread process the new data and SendStr...


I'm shocked that this call can interfere seperate object...

Thank you !

Best regards,
Moro Alexandre.


-Message d'origine-
De : TWSocket [mailto:twsocket-boun...@lists.elists.org] De la part de Moro
Alexandre
Envoyé : vendredi 2 décembre 2016 08:14
À : 'ICS support mailing'
Objet : Re: [twsocket] TWSocket Client Timeout.

I trying to investigate more and more and i see that i cannot open new
sockets on the server, it refuse the connection, below is the packets
captured in wireshark :
Document joint : spuriousretransmission.pcapng

The application i openned who crashed all the twsocket open two new socket
on this server !
And in netstat the server socket are still in listenning state, (it happen
on localhost and from a remote computer).

Moreover the last 4 connection are in FIN_WAIT_2

Maybe it is a start...

Moro Alexandre.

-Message d'origine-
De : TWSocket [mailto:twsocket-boun...@lists.elists.org] De la part de Angus
Robertson - Magenta Systems Ltd Envoyé : jeudi 1 décembre 2016 16:54 À :
twsocket@lists.elists.org Objet : Re: [twsocket] TWSocket Client Timeout.

> In this time, did you already ear something like that with ICS ?
> Have you any idea where data can be blocked, and in this state what 
> can i do more than inspecting by wireshark and netstat ???

If I understand you correctly, you want to keep remote TCP/IP sockets
connected for several days at a time, presumably over a LAN or maybe a WAN? 

There are so many ways a connection can be lost, routers and switches,
hardware issues, software interference, Windows Updates, etc.  

Even with keep alive, TCP/IP sockets can say connected but not be, the only
reliable way is to send and echo data, a proper handshake. 

The probability of it being a bug in ICS that no-one else has noticed is
highly unlikely, but not impossible, as explained previously I did fix a
timeout issue that caused a socket to be closed earlier this year, which I
found in one of my applications. 

You really need to find a way of bullet proofing your application, so it
reconnects if nothing is received for x second/minutes/hours, or use regular
handshaking for a more reliable and shorter timeout. 



Angus





--
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] TWSocket Client Timeout.

2016-12-02 Thread Angus Robertson - Magenta Systems Ltd
> If i remove the SendStr() call, everything works fine !!!

So what did you replace it with?  There is nothing wrong with sending
data, applications do it all the time.

Sorry, you are not really providing adequate information about your
application and which components or even OS, you are using to make any
real suggestions. 

It's very unlikely threads will be necessary, unless you are blocking
ICS somewhere.  

Angus

-- 
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] TWSocket Client Timeout.

2016-12-01 Thread Angus Robertson - Magenta Systems Ltd
> In this time, did you already ear something like that with ICS ?
> Have you any idea where data can be blocked, and in this state 
> what can i do more than inspecting by wireshark and netstat ???

If I understand you correctly, you want to keep remote TCP/IP sockets
connected for several days at a time, presumably over a LAN or maybe a
WAN? 

There are so many ways a connection can be lost, routers and switches,
hardware issues, software interference, Windows Updates, etc.  

Even with keep alive, TCP/IP sockets can say connected but not be, the
only reliable way is to send and echo data, a proper handshake. 

The probability of it being a bug in ICS that no-one else has noticed
is highly unlikely, but not impossible, as explained previously I did
fix a timeout issue that caused a socket to be closed earlier this year,
which I found in one of my applications. 

You really need to find a way of bullet proofing your application, so
it reconnects if nothing is received for x second/minutes/hours, or use
regular handshaking for a more reliable and shorter timeout. 



Angus





-- 
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] TWSocket Client Timeout.

2016-12-01 Thread Moro Alexandre
Hello Everyone,
Again, i'm back with this problem with some news...

I have reproduce the problem :

The configuration :
1 process based on ICS 8.34 with :
a socket server with 4 clients connected (they only receive data) (TCP).
3 connection etablished to 3 different socket server from network devices
(TCP).


Everything worked for 28 Hours.
I started another application which freezed the computer for 1-2 seconds,
and now the problem happen :

Problems :
1) No data output the application
No more data is sent from my application to the 4 clients. (but everyone
says it is well connected).

2) No more data are computed by my application.
I do not received new data. (everyone is connected (netstat), and wireshark
show me the data are well received by the computer).

What can i see :
The processus is not freezed.
All clients show that all TCP connection from and to everyone are in
etablish state (from netstat).
Wireshark show that data from the 3 clients to the processus are well
received on the network interface.
TWSocket client object say that i'm still connected to the 3 clients !

I reproduce this bug for the first time since more than one year and outside
of any IDE so i cannot search were does it really stuck...
I will now try to reproduce the problem from an IDE...

In this time, did you already ear something like that with ICS ?
Have you any idea where data can be blocked, and in this state what can i do
more than inspecting by wireshark and netstat ???

Thank you.

Best regards,
Moro Alexandre.



-Message d'origine-
De : TWSocket [mailto:twsocket-boun...@lists.elists.org] De la part de Moro
Alexandre
Envoyé : mardi 11 octobre 2016 08:37
À : 'ICS support mailing'
Objet : Re: [twsocket] TWSocket Client Timeout.

Hello everyone,

I'm back, and i got good news, i finaly found what was going on :

It is simply a problem half open connection :


The connection between the server and the client (using TWSocket) is
forwarded althrough a Wifi connection (based on 868Mhz, which is really
unstable).
Sometimes when the server sent somes frames to the client, the server
doesn't receive the ACK and the server close the connection from the client.
But, this client doesn't know it, so TWSocket thinks the connection is still
open...

I checked it with netstat on both server and client and it is very clear now
!

To better handle this situation, i changed KeepAlive timeout like that :

mpWSocket->KeepAliveOnOff = wsKeepAliveOnCustom; KeepAliveTime = 25 * 
mpWSocket->1000;

And now, we clearly see that the socket closed itself after these 25 seconds
without data received (when the Wifi is down) and try to reconnect...


Sorry to loose your time, maybe it can help someone encoutered the same
problem.


Best,
Alexandre.


-Message d'origine-
De : TWSocket [mailto:twsocket-boun...@lists.elists.org] De la part de Moro
Alexandre Envoyé : mercredi 5 octobre 2016 08:44 À : 'ICS support mailing'
Objet : Re: [twsocket] TWSocket Client Timeout.

Hello Stephen,

Thank you for sharing and giving me a way to search about.

I searched about theses function in my whole source code but these are not
used.

I looked for something similar like low level code but i did not really find
something interessting...

So wait and see...


-Message d'origine-
De : TWSocket [mailto:twsocket-boun...@lists.elists.org] De la part de
Stephen Dickason Envoyé : mardi 4 octobre 2016 18:52 À : ICS support mailing
Objet : Re: [twsocket] TWSocket Client Timeout.

Please pardon me for butting in.  I can share what I found broke ICS for me
and you can check if you have anything similar.

I used a separate piece of low level code (not ICS) in my about form that
displayed the host name and IP address of the user's PC, it used
winsock.gethostname, WSAStartup($101,...) and WSACleanup.  (I don't remember
which one was the culprit.) This I found broke any open socket connections
that I had and only way to see if they were broken was something like cmd's
netstat -a. It was rather a bother, as not many people check the about box,
so was quite random, showed no errors and was pretty annoying.
I fixed it a long time ago by using internal ICS functions instead.

Hope it helps.


Stephen Dickason
Senior Developer - Managed Services
  Email: sdicka...@elcb.co.za

ELCB Information Services (Pty) Ltd
Customer Service Email  e...@elcb.co.za * www.elcb.co.za E A S T  L O N D O
N
Tel: +27(43)  704 0700
Fax: +27(43) 704 0701
J O H A N N E S B U R G
Tel: +27(11) 879 6179
Fax: +27(11) 454 0384
P O R T  E L I Z A B E T H
Tel: +27(41) 373 0529
Fax: +27(86) 650 0135
Disclaimer

> -Original Message-
> From: TWSocket [mailto:twsocket-boun...@lists.elists.org] On Behalf Of 
> Moro Alexandre
> Sent: Tuesday, October 4, 2016 17:19
> To: 'ICS support mailing'
> Subject: Re: [twsocket] TWSocket Client Timeout.
>
> Hi Angus,
>
> Sorry to bother you, please find more details :
>
> In fact, an user use our application 

Re: [twsocket] TWSocket Client Timeout.

2016-10-05 Thread Moro Alexandre
I really know these are very poor details, but like i say, this is a report
from a customer and not a developper, 
sadly, i did not reproduce this problem more than one year after the first
time it happens...
The new thing i can say is that the user must restart the program to
retrieve the data again.
Since our source code logic do not change between the update of ICS it let
me think that it is related to that. 

I asked you to see if, maybe, you know a way to search about, like Stephen
Dickason and his WSAStartup...

Apparently, this fix you provide can really be linked to my problem.
When i say the connection is still open, i mean : a green light on the form
based on IsConnected() are still green (Informations comes from user not
developpers)! 

So i already upgraded to the latest version and i going to try it on the
user computer to try to reproduce the problem myself...

But i believe in this fix !

Thanks for your time.


Alexandre.


-Message d'origine-
De : TWSocket [mailto:twsocket-boun...@lists.elists.org] De la part de Angus
Robertson - Magenta Systems Ltd
Envoyé : mardi 4 octobre 2016 17:42
À : twsocket@lists.elists.org
Objet : Re: [twsocket] TWSocket Client Timeout.

> Sorry to bother you, please find more details :

Sorry, still no real detail of any use for diagnostics.

I suggest you upgrade to the latest ICS V8.34, we don't use SVN commit
versions, and add more diagnostics into your application to try and trace
your problem.  

The timeout error I fixed related to a idle connection being deliberately
closed by ICS when it was not actually idle (because a counter was not
updated) but you say the connection is not closed.  

I have TCP connections running continually for days or weeks without any
data being lost, it is unlikely to be an ICS problem. 

Angus
 

--
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] TWSocket Client Timeout.

2016-10-04 Thread Stephen Dickason
Please pardon me for butting in.  I can share what I found broke ICS for me and 
you can check if you have anything similar.

I used a separate piece of low level code (not ICS) in my about form that 
displayed the host name and IP address of the user's PC, it used 
winsock.gethostname, WSAStartup($101,...) and WSACleanup.  (I don't remember 
which one was the culprit.)
This I found broke any open socket connections that I had and only way to see 
if they were broken was something like cmd's netstat -a. It was rather a 
bother, as not many people check the about box, so was quite random, showed no 
errors and was pretty annoying.
I fixed it a long time ago by using internal ICS functions instead.

Hope it helps.


Stephen Dickason
Senior Developer - Managed Services
  Email: sdicka...@elcb.co.za

ELCB Information Services (Pty) Ltd
Customer Service Email  e...@elcb.co.za * www.elcb.co.za
E A S T  L O N D O N
Tel: +27(43)  704 0700
Fax: +27(43) 704 0701
J O H A N N E S B U R G
Tel: +27(11) 879 6179
Fax: +27(11) 454 0384
P O R T  E L I Z A B E T H
Tel: +27(41) 373 0529
Fax: +27(86) 650 0135
Disclaimer

> -Original Message-
> From: TWSocket [mailto:twsocket-boun...@lists.elists.org] On Behalf Of Moro
> Alexandre
> Sent: Tuesday, October 4, 2016 17:19
> To: 'ICS support mailing'
> Subject: Re: [twsocket] TWSocket Client Timeout.
>
> Hi Angus,
>
> Sorry to bother you, please find more details :
>
> In fact, an user use our application to retrieve data from a device by a TCP
> connection throught TWSocket.
>
> The problem is that after a certain time (between 5 and 8 hours) the data stop
> being received but TWSocket still indicate that it is connected.
>
> The user has reproduce the problem multiple times.
>
> This problem only appears since one year : when we have updated C++ Builder
> and ICS :
>
> From Borland Builder 6 to Embarcadero XE3 From ICS 5.25 to ICS r1196.
>
> I do not have more details since i can not reproduce this problem myself.
> But we are going to reproduce it this weekend.
>
> Finaly, i just see that you have fix some problems with timeout and
> WSAESHUTDOWN in the version r1280 and r1279, so since it is related to time
> maybe it fix my problem of 5/8 Hours...
>
> I cannot reproduce the original problem, unfortunately i cannot try it for the
> moment !
>
> Thanks again !!!
>
> Alexandre.
>
>
-- 
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] [TWSocket]ICS8.26: undeclared identifier 'TSslEngine'

2016-05-15 Thread Jarek Karciarz
Hello,

 

I am not able to compile design time package. 

Simply TSslEngine component cannot be found.

 

I am using RAD 2007. Only change I make in original packages is linker
option as I check: Generate all C++ files.

 

I can suppress this error just by defining OPENSSL_NO_ENGINE which is not
defined by default.

Do I lose much functionality after changing this?

Anyway looking into code I cannot find the reason why the class TSslEngine
is not found. Has anyone successfully compiled the package for RAD2007
without changing the INC file?

 

Regards

Jarek

 

-- 
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] twsocket] Gmail--04-04-2016

2016-04-12 Thread zayin
More data.

I tried the sample project OverbyteIcsSslMailSnd and I get the same error.

Interesting.



-- 
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] TWSocket Digest, Vol 646, Issue 2

2016-03-29 Thread ROQUES Guillaume

Happy birthday ICS 's Team 

Thanks for all these years !

Le 28/03/2016 13:00, twsocket-requ...@lists.elists.org a écrit :

Send TWSocket mailing list submissions to
twsocket@lists.elists.org

To subscribe or unsubscribe via the World Wide Web, visit
http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
or, via email, send a message with subject or body 'help' to
twsocket-requ...@lists.elists.org

You can reach the person managing the list at
twsocket-ow...@lists.elists.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of TWSocket digest..."


Today's Topics:

1. Re: ICS reaches 20 years ! (Dod)
2. Re: ICS reaches 20 years ! (Frans van Daalen)
3. Re: ICS reaches 20 years ! (Darin McGee)
4. Re: ICS reaches 20 years ! (Darin McGee)
5. Re: ICS reaches 20 years ! (Jasja Glasbeek)


___
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] TWSocket Digest, Vol 634, Issue 1

2015-12-29 Thread François Piette
> Registered, but it won't let me edit TnScript page, seems I need to be in
the 'writer' group to do edits.

You have to email me privately the usercode you selected, then I can give
you write access.

--
francois.pie...@overbyte.be
The author of the freeware multi-tier middleware MidWare
The author of the freeware Internet Component Suite (ICS)
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] TWSocket Digest, Vol 634, Issue 1

2015-12-29 Thread Stephen Dickason
>> Registered, but it won't let me edit TnScript page, seems I need to be
>> in the 'writer' group to do edits.
>You have to email me privately the usercode you selected, then I can give you 
>write access.

Thanks, will do.

Stephen Dickason
Senior Developer - Managed Services
  Email: sdicka...@elcb.co.za

ELCB Information Services (Pty) Ltd
Customer Service Email  e...@elcb.co.za * www.elcb.co.za
E A S T  L O N D O N
Tel: +27(43)  704 0700
Fax: +27(43) 704 0701
J O H A N N E S B U R G
Tel: +27(11) 879 6179
Fax: +27(11) 454 0384
P O R T  E L I Z A B E T H
Tel: +27(41) 373 0529
Fax: +27(86) 650 0135
Disclaimer

-- 
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] TWSocket Digest, Vol 634, Issue 1

2015-12-29 Thread Angus Robertson - Magenta Systems Ltd
> *Subject:* Re: [twsocket] TWSocket Digest, Vol 634, Issue 1
> Registered, but it won't let me edit TnScript page, seems I need to be in 
> the 'writer' group to do edits.

You need to wait for François Piette to approve your editing rights. 

Angus

-- 
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] TWSocket Digest, Vol 634, Issue 1

2015-12-29 Thread Stephen Dickason
>as for the wiki: it would be great if you would contribute tz it.
>Just register there and when being confirmed start editing!
>There were many people in the past promising to help with the wiki. They 
>registered and were never seen again there :-( I hope you register and 
>add/modify a bit in the wiki. You're welcome to do so!

Registered, but it won't let me edit TnScript page, seems I need to be in the 
'writer' group to do edits.


Stephen Dickason
Senior Developer - Managed Services
  Email: sdicka...@elcb.co.za

ELCB Information Services (Pty) Ltd
Customer Service Email  e...@elcb.co.za * www.elcb.co.za
E A S T  L O N D O N
Tel: +27(43)  704 0700
Fax: +27(43) 704 0701
J O H A N N E S B U R G
Tel: +27(11) 879 6179
Fax: +27(11) 454 0384
P O R T  E L I Z A B E T H
Tel: +27(41) 373 0529
Fax: +27(86) 650 0135
Disclaimer

-- 
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] TWSocket Digest, Vol 634, Issue 1

2015-12-29 Thread Markus Humm
> Message: 3
> Date: Tue, 29 Dec 2015 11:36:34 +
> From: Stephen Dickason 
> To: "twsocket@lists.elists.org" 
> Subject: [twsocket] FW:  ICS contributions faq
> Message-ID:
>   <23c0cbd4325cb84dabd7533e8cdc613701ed532...@femia.elcb.co.za>
> Content-Type: text/plain; charset="us-ascii"
> 
> Thanks for the quick response.
> 
>>> I seem to be missing it, but can't find where I can contribute source
>>> code enhancements or perhaps help with the wiki.
>> If you have enhancements, please make sure they are made to the latest 
>> overnight SVN version, and email them directly to me, not this list unless 
>> only a couple of lines.
>> I'll test and integrate the changes into SVN.
> 
> After checking that I am using latest version, I see that I've done more 
> modifications than I thought I had.  (Made a non-visual telnet component) 
> Will try and reconcile and send it through.
> 
> Modifications are on the telnet scripting component, where I change the 
> ProcessInputData method to scan a first character array before testing each 
> search string.  It seems from my logging that it runs faster (roughly 4x), 
> although it has extra overhead setting up and removing search strings.  It's 
> probably still not totally optimised.
> 
> Regards
> 
> 
> 
> Stephen Dickason
> Senior Developer - Managed Services
>   Email: sdicka...@elcb.co.za
> 
> ELCB Information Services (Pty) Ltd
> Customer Service Email  e...@elcb.co.za * www.elcb.co.za E A S T  L O N D O N
> Tel: +27(43)  704 0700
> Fax: +27(43) 704 0701
> J O H A N N E S B U R G
> Tel: +27(11) 879 6179
> Fax: +27(11) 454 0384
> P O R T  E L I Z A B E T H
> Tel: +27(41) 373 0529
> Fax: +27(86) 650 0135
> Disclaimer
> 
> 
> 
> Stephen Dickason
> Senior Developer - Managed Services
>   Email: sdicka...@elcb.co.za
> 
> ELCB Information Services (Pty) Ltd
> Customer Service Email  e...@elcb.co.za * www.elcb.co.za
> E A S T  L O N D O N
> Tel: +27(43)  704 0700
> Fax: +27(43) 704 0701
> J O H A N N E S B U R G
> Tel: +27(11) 879 6179
> Fax: +27(11) 454 0384
> P O R T  E L I Z A B E T H
> Tel: +27(41) 373 0529
> Fax: +27(86) 650 0135
> Disclaimer
> 

Hello,

as for the wiki: it would be great if you would contribute tz it.
Just regiter there and when being confirmed start editing!
There were many people in the past promising to help with the wiki. They
registered and were never seen again there :-(
I hope you register and add/modify a bit in the wiki. You're welcome to
do so!

Greetings

Markus
-- 
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] TWSocket Client Timeout.

2015-06-11 Thread Moro Alexandre
Hello Angus,

Thanks for your fast response.

But no other application could effect this property.
Fo sure, I understand that no other application can change this var in my
application (normaly), 
but i'm talking at i higher level...

However other applications can change the TCP/IP timer parameters 
This is what i'm thinking about.

But since my TWSocket client only receive data and never sent any data, 
i believe an antivirus or a firewall or windows with changed TCP/IP
parameters,
can thing it is a bad connection and close it after a while (5hours in my
case).

A normal TCP/IP socket never tries to reconnect, your applications controls
all that.
You are not talking about TWSocket...
Because i doesn't implement anything in this way in my program and TWSocket
already manage it correclty :
If I etablish a connection to a server then stop and restart the server
TWSocket client retablish the connection automatically...

Anyway, i will try to remove all applications who can act on ethernet
connection first...

Thanks.


-Message d'origine-
De : TWSocket [mailto:twsocket-boun...@lists.elists.org] De la part de Angus
Robertson - Magenta Systems Ltd
Envoyé : jeudi 11 juin 2015 11:02
À : twsocket@lists.elists.org
Objet : Re: [twsocket] TWSocket Client Timeout.

 Is it possible that the default 0 timeout on TWSocket will be replace 
 by another program like Anti Virus or Firewall ?
 I see that by default TimeoutIdle is set to zero, does it can change 
 something if a force this to the maximum unsigned int value ?

The TimeoutIdle property is part of an undocumented, experimental
TCustomTimeoutWSocket component.  Without examining the code, I've no idea
what this property is designed to do, never used it.  But no other
application could effect this property. 
 
Generally, Windows TCP/IP registry setting define to connection timeout,
there is no inherent idle timeout in TCP/IP.  However other applications can
change the TCP/IP timer parameters, generally not a good idea.  And other
applications might close what they consider to be an idle connection.  
   
 Another way : I there a maximum number of reconnection allowed during 
 a connection ?

A normal TCP/IP socket never tries to reconnect, your applications controls
all that.


Angus

--
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] TWSocket Client Timeout.

2015-06-11 Thread Moro Alexandre
Hello,

 

Is it possible that the default 0 timeout on TWSocket will be replace by
another program like Anti Virus or Firewall ?

 

My case : 

 

I got 4 differents clients socket connected to 4 differents server on a
first computer. 

After about 5 hours, someone lost the connection (between 3 and 4 clients).

 

On a second computer with the same setup, connections are still working.

 

I see that by default TimeoutIdle is set to zero, does it can change
something if a force this to the maximum unsigned int value ?

 

Another way : I there a maximum number of reconnection allowed during a
connection ?

 

Thanks you.

 

-- 
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] TWSocket Digest, Vol 591, Issue 4

2014-12-06 Thread Markus Humm
Am 06.12.2014 13:00, schrieb twsocket-requ...@lists.elists.org:
 procedure TLobbyServer.SocketServerDataAvailable(Sender: TObject; ErrCode: 
 Word);
 begin
if ErrCode  0 then Exit;
   with Sender as TWSocketClient do
   begin
 RunCommand(ReceiveStr, Sender as TWSocketClient);
   end;
 end;

Hello,

unless you use LineMode the code above doesn't guarantee that each of
your command strings is being transmitted in one single string over the
network. So it could be that you get several SocketServerDataAvailable
events for the same command, each containing another part of the string.
The only guarantee you have in such a case is, that the order in which
you get the events is the correct one.

= either use line mode or implement your own buffering system

Greetings

Markus
-- 
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] TWSocket Digest, Vol 589, Issue 1

2014-11-20 Thread Christian Giesen
Good day Michael,

Thanks for the response. I have followed your instructions and successfully
installed ICS 8 into DXE7. Thanks for the good advice in providing the
solution to my issue..

Kind regards,
Christian Giesen


Christian Giesen
Managing Member
Express Talent

EMail: ch...@xt.co.za
Tel: +27 31 776 4952
Cell: +27 82 5745566

This message contains private and confidential Information. If you are not
the intended addressee indicated in this message or you are not responsible
for the delivery of such messages to the intended recipient, you may not
copy or deliver this message to anyone. You may not use any information
gleaned from this message for the benefit or promotion of yourself or your
organization. If such is the case, please destroy this message immediately
and kindly notify the sender by return of E-Mail. Express Talent cc takes
no responsibility whatsoever resulting in you misusing information
contained in this message and doing so may render you liable for the
consequences of misusing said content of this E-Mail message.

On Wed, Nov 19, 2014 at 2:00 PM, twsocket-requ...@lists.elists.org wrote:

 Send TWSocket mailing list submissions to
 twsocket@lists.elists.org

 To subscribe or unsubscribe via the World Wide Web, visit
 http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
 or, via email, send a message with subject or body 'help' to
 twsocket-requ...@lists.elists.org

 You can reach the person managing the list at
 twsocket-ow...@lists.elists.org

 When replying, please edit your Subject line so it is more specific
 than Re: Contents of TWSocket digest...


 Today's Topics:

1. ICS  RAD Studio XE7 (Christian Giesen)
2. ICS  RAD Studio XE7 (Christian Giesen)
3. Re: ICS  RAD Studio XE7 (Michael Gasser (privat))
4. OT: Let's Encrypt free SSL/TLS certificates
   (Angus Robertson - Magenta Systems Ltd)


 --

 Message: 1
 Date: Wed, 19 Nov 2014 06:06:05 +0200
 From: Christian Giesen ch...@xt.co.za
 To: twsocket@lists.elists.org
 Subject: [twsocket] ICS  RAD Studio XE7
 Message-ID:
 
 capdgfw9af7ufjtibxmyfpmfuahyexqob4kmpzeazyobuqtv...@mail.gmail.com
 Content-Type: text/plain; charset=UTF-8

 Good day all,

 We have just upgraded from RAD Studio XE5 to XE7. We use your ICS
 components quite extensively. Can you tell me when you will have a release
 for XE7? This link claims that ICS 8 Gold supports XE7 but the latest
 packages in this version only go up to XE5.

 http://wiki.overbyte.be/wiki/index.php/ICS_Download

 The home page still has the ICS 8 Gold as the latest available version.

 I have tried to access the link indicated in the above web page but the
 link is either dead or takes so long to access that it eventually times out
 with the usual URL timeout errors:
 http://svn.overbyte.be:8443/svn/ics/trunk

 Any advice would be greatly appreciated.

 ?Thanking you in advance.?


 Christian Giesen
 Managing Member
 Express Talent

 EMail: ch...@xt.co.za
 Tel: +27 31 776 4952
 Cell: +27 82 5745566

 This message contains private and confidential Information. If you are not
 the intended addressee indicated in this message or you are not responsible
 for the delivery of such messages to the intended recipient, you may not
 copy or deliver this message to anyone. You may not use any information
 gleaned from this message for the benefit or promotion of yourself or your
 organization. If such is the case, please destroy this message immediately
 and kindly notify the sender by return of E-Mail. Express Talent cc takes
 no responsibility whatsoever resulting in you misusing information
 contained in this message and doing so may render you liable for the
 consequences of misusing said content of this E-Mail message.


 --

 Message: 2
 Date: Wed, 19 Nov 2014 06:12:26 +0200
 From: Christian Giesen ch...@xt.co.za
 To: twsocket@lists.elists.org
 Subject: [twsocket] ICS  RAD Studio XE7
 Message-ID:
 CAPDgfw9S5sgTVQK0Jv3ZDWi=
 cjitzhjddtcq+dxqcbvbcpw...@mail.gmail.com
 Content-Type: text/plain; charset=UTF-8

 Good day all,

 We have just upgraded from RAD Studio XE5 to XE7. We use your ICS
 components quite extensively. Can you tell me when you will have a release
 for XE7? This link claims that ICS 8 Gold supports XE7 but the latest
 packages in this version only go up to XE5.

 http://wiki.overbyte.be/wiki/index.php/ICS_Download

 The home page still has the ICS 8 Gold as the latest available version.

 I have tried to access the link indicated in the above web page but the
 link is either dead or takes so long to access that it eventually times out
 with the usual URL timeout errors:
 http://svn.overbyte.be:8443/svn/ics/trunk

 Any advice would be greatly appreciated.

 ?Thanking you in advance.

 Christian Giesen
 Managing Member
 Express Talent

 EMail: ch...@xt.co.za
 Tel: +27 31 776 4952
 Cell: +27 82 5745566

 This 

Re: [twsocket] TWSocket problem

2014-02-17 Thread Noam weissman
Hi,

Well the problem was found and it was a misunderstanding on my behalf.

My sending function is a bit complicated. It involves reading from file
and updating the display.
The OnDataSent event was calling my function. The problem was that the
event was triggered faster
then expected. As a result my function was called recursively. 

I found the clue in one of older posts and also a this old but good help
gave more insight: 
  http://www.mestdagh.biz/ics/help

I changed my code and instead of calling the sending function directly
from the OnDataSent I am posting 
a message inside the OnDataSent event to the window. 

Just to be on the safe side I have also added a CriticalSection in my
sending function. This way even if 
the OnDataSent is triggered before I finish handling everything, it is
stalled.

Now the send process is completely synchronized without the need of
adding delays etc...


Thanks,
Noam.


-Original Message-
From: TWSocket [mailto:twsocket-boun...@lists.elists.org] On Behalf Of
Noam weissman
Sent: Monday, February 17, 2014 12:14 AM
To: twsocket@lists.elists.org
Subject: [twsocket] TWSocket problem

Hi,
 

I am working on a control application that uses a few ICS components.
One of this application options is firmware update to embedded device
over TCP.

I have created a form that has one TWSocket, a few timers, progress bar
etc... In general the user chooses a file to download to the device and
clicks a button to start the process.
This form is created dynamically, it creates the socket and all. The
application can open as many forms as the user needs. Every form has its
own state machine and its own buffer , socket etc...

The update worked fine for a single device and even for 2-3 concurrent
updates.  For some reason when I triad running more then 4 forms,
sometimes the application crashed completely, sometimes one of the forms
stopped the file transfer and timed out.

After making a few changes I am now stacked with a Stack Overflow
exception and no matter what I do I cannot run even one form.

The stack overflow is inside the TWSocket. I am sending a 4K bye buffer
and then in the DataSent event I send another one and another one...

Actually the stack overflow happened when I triad to send smaller
buffers (1K) now even after returning to the previous code with 4K
buffer I still get the stack overflow.

I am using XE4 with C++

Any ideas or suggestions would be appreciated.


BR,
Noam.

   

 
 


This footnote confirms that this email message has been scanned by
PineApp Mail-SeCure for the presence of malicious code, vandals 
computer viruses.





--
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

 
 


This footnote confirms that this email message has been scanned by
PineApp Mail-SeCure for the presence of malicious code, vandals 
computer viruses.






 
 

This footnote confirms that this email message has been scanned by
PineApp Mail-SeCure for the presence of malicious code, vandals  computer 
viruses.




-- 
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] TWSocket problem

2014-02-16 Thread Noam weissman
Hi,
 

I am working on a control application that uses a few ICS components.
One of this application options is firmware update to embedded device over TCP.

I have created a form that has one TWSocket, a few timers, progress bar etc…
In general the user chooses a file to download to the device and clicks a 
button to start the process.
This form is created dynamically, it creates the socket and all. The 
application can open as many 
forms as the user needs. Every form has its own state machine and its own 
buffer , socket etc…

The update worked fine for a single device and even for 2-3 concurrent updates. 
 For some reason when 
I triad running more then 4 forms, sometimes the application crashed 
completely, sometimes one of the 
forms stopped the file transfer and timed out.

After making a few changes I am now stacked with a Stack Overflow exception and 
no matter what I 
do I cannot run even one form.

The stack overflow is inside the TWSocket. I am sending a 4K bye buffer and 
then in the DataSent event I 
send another one and another one…

Actually the stack overflow happened when I triad to send smaller buffers (1K) 
now even after returning
to the previous code with 4K buffer I still get the stack overflow.

I am using XE4 with C++

Any ideas or suggestions would be appreciated.


BR,
Noam.

   

 
 

This footnote confirms that this email message has been scanned by
PineApp Mail-SeCure for the presence of malicious code, vandals  computer 
viruses.




-- 
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] TWSocket Digest, Vol 554, Issue 3

2014-01-30 Thread Michael Gasser


Hi Noam

I think you should set breakpoints directly in the socket component (or even 
add some test code) to (maybe ;-)) see what happens.


Define a global flag F: boolean

In your code:
Before you assign values to ip and port
1. set F to true.
2. set a tag number for your socket, f.e. yoursocket.tag = 1234

Before you call connect
1. reset the F to false.

In the Socket component:
Wherever the ip or port are set to '' set a breakpoint with condition 
(F=true) AND (tag=1234).




Best regards
Michael




Message: 1
Date: Tue, 28 Jan 2014 23:17:43 +0200
From: Noam weissman n...@silrd.com
To: ICS support mailing twsocket@lists.elists.org
Subject: Re: [twsocket] TWSocket strange problem
Message-ID:
e44d48019612554d82017d1e60a164d502777...@sil-exchange.silora.co.il
Content-Type: text/plain; charset=ISO-8859-1

Hi,


Yes I run a few examples before using the components.

My current application has actually a few sockets.

I have a ping component checking if devices are online/offline. This is in 
its

own thread.

I have two sockets one for sending and one for receiving working in a 
separate

module with their own thread.

The socket that I have problems with is running in a separate thread

I added a testing code after assigning the Port and Addr, Something like 
this:


if((Socket-Addr == NULL) || (Socket-Port == 0))
{

And that was before even calling Connect...

Once in a few run's I got one of the above 0 or even both ?

I am sure that I am writing the port and IP values.

BR,
noam.



--
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] TWSocket strange problem

2014-01-28 Thread François Piette
Everything works just fine except that once in a few restarts to my
application I get an exception
that IP address is not defined. My IP is defined and has no problems that I
can see ?

Try assigning IP, Port and Proto each time before calling connect.

-- 
francois.pie...@overbyte.be
Embarcadero MVP
http://www.overbyte.be
http://francois-piette.blogspot.com





-- 
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] TWSocket strange problem

2014-01-28 Thread François Piette
 I may have a problem in my code but this is a bit strange ?

Have you tested with one of the supplied samples ?

-- 
francois.pie...@overbyte.be
Embarcadero MVP
http://www.overbyte.be
http://francois-piette.blogspot.com





-- 
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] TWSocket strange problem

2014-01-28 Thread Noam weissman
Hi,


Yes I run a few examples before using the components.

My current application has actually a few sockets.

I have a ping component checking if devices are online/offline. This is in its
own thread.

I have two sockets one for sending and one for receiving working in a separate
module with their own thread.

The socket that I have problems with is running in a separate thread 

I added a testing code after assigning the Port and Addr, Something like this:

if((Socket-Addr == NULL) || (Socket-Port == 0))
{

And that was before even calling Connect...

Once in a few run's I got one of the above 0 or even both ?

I am sure that I am writing the port and IP values.

BR,
noam.


-Original Message-
From: TWSocket on behalf of François Piette
Sent: Tue 1/28/2014 11:00 PM
To: 'ICS support mailing'
Subject: Re: [twsocket] TWSocket strange problem
 
 I may have a problem in my code but this is a bit strange ?

Have you tested with one of the supplied samples ?

-- 
francois.pie...@overbyte.be
Embarcadero MVP
http://www.overbyte.be
http://francois-piette.blogspot.com





-- 
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

 
 

This footnote confirms that this email message has been scanned by
PineApp Mail-SeCure for the presence of malicious code, vandals  computer 
viruses.






 
 

This footnote confirms that this email message has been scanned by
PineApp Mail-SeCure for the presence of malicious code, vandals  computer 
viruses.




-- 
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] TWSocket Digest, Vol 550, Issue 2

2013-12-24 Thread Павел Пикулин
Thank you. But
*François Piette fixed error*

  PostMessage(Handle,
FMsg_WM_ASYNCSELECT,
WParam(FHSocket),
IcsMakeLong(FD_WRITE, 0));
-- 
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] TWSocket Digest, Vol 550, Issue 2

2013-12-24 Thread François Piette
This fix is not OK. FHSocket may be negative. It has to be cast to WParam.
See other messages.
-- 
francois.pie...@overbyte.be
Embarcadero MVP
http://www.overbyte.be
http://francois-piette.blogspot.com





-Message d'origine-
De : TWSocket [mailto:twsocket-boun...@lists.elists.org] De la part de
Michael Gasser
Envoyé : mardi 24 décembre 2013 12:06
À : twsocket@lists.elists.org
Objet : Re: [twsocket] TWSocket Digest, Vol 550, Issue 2



Hi pde...@gmail.com

I still think there is a little bug in OverbyteIcsWSocket.pas (most recent
version 8.06 of OverbyteIcsWSocket.pas [ISC v7 was OK]) wihich causes this
problem in function TCustomWSocket.Send(Data : TWSocketData; Len : Integer)
: Integer; at line PostMessage(Handle, FMsg_WM_ASYNCSELECT, FHSocket,
IcsMakeLong(FD_WRITE, 0));

[described in my posts 7.11. 12.11.2013]

In some cases the values of FHSocket, FState are FHSocket 1 and FState =
wsConneced WHILE ENTERING the function TCustomWSocket.Send - BUT their
values change to -1, wsClosed in TryToSend;  [socket not connected]

If these values change to -1, wsClosed (in TryToSend; ) the error you
describe occurs.


To get rid of the error you mention:

1. Open OverbyteIcsWSocket.pas
2. In  OverbyteIcsWSocket.pas search for TCustomWSocket.Send.

Code as is:
if bAllSent then begin
{ We post a message to fire the FD_WRITE message which in turn will}
...
{ the send function.   }
PostMessage(Handle,
FMsg_WM_ASYNCSELECT,
FHSocket,
IcsMakeLong(FD_WRITE, 0));
end;

Add the line if FHSocket  0 :

if bAllSent then begin
{ We post a message to fire the FD_WRITE message which in turn will}
...
{ the send function.   }
if FHSocket  0 then  // add this line...
PostMessage(Handle,
FMsg_WM_ASYNCSELECT,
FHSocket,
IcsMakeLong(FD_WRITE, 0));
end;


This fixes your problem.

or even better:
Go to the procedure TryToSend; and set the variable bAllSent to false 
whenever an error like #10057 occurrs. This fixes the problem too.


Regards
Michael




 Message: 1
 Date: Sat, 21 Dec 2013 15:06:45 +0200
 From: ? ??? pde...@gmail.com
 To: twsocket@lists.elists.org twsocket@lists.elists.org
 Subject: [twsocket] Errors while send, if client disconnected from
 socket
 Message-ID:
 CA+70vSCkD396D+CbzGpCzxWFhPNX68VktK9byvTwQw6fuF=j...@mail.gmail.com
 Content-Type: text/plain; charset=ISO-8859-1

 Hello

 Sometimes client can disconnect on multithreaded server while send, after
 that I receive
 Range check error or
 Socket is not connected (#10057 in Send)

 How can I avoid these errors?
 I'm checking client state before send.
 Must I ignore both these errors? If yes, I can understand to ignore
 #10057, but why shuld I ignore range check error.
 It is very rarely error (one time on 1.000.000 send), but it happens every
 day on my server.

 //TTCPClient = class(TsslWSocketTHrdClient)

  if (FTcpClient as TTCPClient).state = wsConnected then
try
  (ftcpclient as TTCPClient).Send(data, 4);
 // here error (in debug I see that client disconnected after entering in
 function Send
except
  on e: exception do
log.debug('Error in sendstr TClient.writelnuncompressed:' +
 e.Message);
end;


 Thank you.


 

-- 
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