Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
using ICS Overbyte component on IntraWeb Problem
#1
Hello everyone and support,

I have problem about use ICS Overbyte component on IntraWeb application.

About, I use TWSocket component of ICS for WebSocket client and it has error "Invalid argument (#10022 in WSAAsyncSelect)" when try to connect to WebSocket Server or try to send data to Websocket server.

Before, I ask to Delphipraxis ICS forum in this: link delphipraxis ics topic and Mr. François PIETTE who is created ICS compoent told me through the forum that:

Quote:Now I'm convinced that this is an issue with IntraWeb. The test program has nothing to do with ICS. It only make use of the same fundamental Windows functions that ICS uses. If the test program doesn't work, then ICS won't work either.

I suggest you contact IntraWeb support with the test programs (Both VCL and IntraWeb) so that they can fix their code.

Please guide me for fix this error for InraWeb application. Because, I try this component VCL applicaiton it's working normally.
Reply
#2
This is not an IW issue. ICS uses messages which do NOT work in threads. Francois even tells you this in his first message.

Why not just use Indy instead which works in threads without any requirements? IntraWeb uses Indy and its already included.
Reply
#3
(03-10-2022, 11:27 PM)kudzu Wrote: This is not an IW issue. ICS uses messages which do NOT work in threads. Francois even tells you this in his first message.

If you read the rest of the discussion, they were able to reproduce a different Win32 error (1400) in code that is running within IntraWeb, without using ICS at all. So, there is something fishy going on when using a Win32 HWND + window messages within the context of IntraWeb.

(03-10-2022, 11:27 PM)kudzu Wrote: Why not just use Indy instead which works in threads without any requirements? IntraWeb uses Indy and its already included.

I do agree with that sentiment in general, but that is not the issue here, once ICS was removed from the equation.

Reply
#4
"So, there is something fishy going on when using a Win32 HWND + window messages within the context of IntraWeb."

Thats not correct. IntraWeb uses standard threads. It does nothing special. Using messages in threads typically is a bad idea all around to begin with.
Reply
#5
First things first:

AllocateHWnd is not thread-safe. This has been known for a long time now. Your code the way it is shouldn't be running at all inside a multi-threaded server.

IntraWeb doesn't call/use AllocateHWnd like that. Instead it uses a patched version of MakeObjectInstance() which is thread-safe.

I suggest that you attach your sample project (zip file containing the whole source code) to this thread and I can take a look. However, as mentioned above, this code of yours the way it is can only be used for testing purposes, otherwise it will definitely crash your server.
Reply
#6
This is Link for download my delphi project group file. There are 3 projects

A. ICS on IntraWeb : Client
B. ICS on VCL : Client (from SocketDomos "OverbyteIcsCli7")
C. ICS on VCL : Server (from SocketDomos "OverbyteIcsTcpSrv")
 
You can test A vs C(have the problem) , or B vs C (no problem)

And you can download ICS V8.68 Component within this Link download from ICS Overbyte

Thank you
Reply
#7
Using ICS in a threaded application is a fools errand. Im being as kind as I can. ICS is a fine product, but was never designed for threads. Adding messages into threads only complicates things and creates overhead. Then add in the complexities of running threads under IIS etc.....

Switching to Indy which is designed for threads is far easier and I see no obstacles other than resistance to do so.
Reply
#8
..and this isn't even to mention the issues you will have because of pooled threads......
Reply
#9
Hello kudze,

Thank your for your advice to change from use ICS on IntraWeb to Indy. I try to read in Indy10 Doc link, but I is bad link. And I try to find demo sample of Indy TCP socket, I found this link for use TIdTCPServer, TIdTCPClient, TIdThreadComponent.(Or if you have a good example of how to use it, please suggest me.)

For now, if ICS is not working on IntraWeb, I will test using Indy first to solve the problem through this point.
Reply
#10
(03-18-2022, 05:16 AM)baxing Wrote: I try to read in Indy10 Doc link, but I is bad link.

Links to old Indy website pages are currently broken

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)