Solved

Are Indy components based on blocking sockets?

Posted on 2009-05-14
5
498 Views
Last Modified: 2013-11-23

  hi experts,

       Delphi Indy components are based on blocking sockets. Why they are designed as blocking sockets style.
 
               Can you please explain me.
0
Comment
Question by:inampudi1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 6

Accepted Solution

by:
twocandles earned 125 total points
ID: 24383390
Here you have Indy team explanation:

http://www.swissdelphicenter.ch/en/showarticle.php?id=4
0
 
LVL 5

Assisted Solution

by:wd123
wd123 earned 125 total points
ID: 24383419
0
 
LVL 12

Assisted Solution

by:Hypo
Hypo earned 125 total points
ID: 24383539
Yes,
Indy components are based on blocking sockets, and my guess why they are is that blocking sockets is actually easier and offer a much more robust way of working with network communication than what non-blocking sockets do.

A couple of years ago I worked for a company on quite a large application that was using non-blocking sockets (It was using the native VCL TServerSocket/TClientSocket) to communicate with different modules over TCP/IP. It worked fine most of the time, but sometimes I would run into problems; like for instance when I had to have a two way communication from within a function in my code, where the response from the clients would influence how the function would react next; and the Event based messaging just forced my function to be transformed into some kind of state machine, where variables in my code had to keep track of waht state the communication with the clients where in for different functions. If the application would have used blocking sockets, then I could have just written my function straight up, but with the non-blocking sockets it was just not possible to do in a good way.

When I used Indy for the first time after that experience, it became clear to me how much easier my work would have been if they had used blocking sockets instead of non-blocking sockets.

Sure, It's faster to start working with non-blocking sockets in a GUI-application, since it fit's the whole event based structure, and that the application itself don't freeze when it waits for a response; also, using blocking sockets require that you know thread programming quite well, and are used to doing good exception handling, but if you do know these stuff, then I think you will see that in the long run, when the communication becomes a little bit more advanced than just sending and receiving simple messages, there are benefits of using blocking sockets over non-blocking.

regards
Hypo
0
 
LVL 19

Assisted Solution

by:MerijnB
MerijnB earned 125 total points
ID: 24384433
With Hypo,

I just want to add that (imho) the choice between blocking and non-blocking really depends on what kind of data you are going to transmit. If it's a protocol where a response from a client has influence on what to do next (like Hypo describes), blocking is surely the better option. In other cases non-blocking is easier to grasp (and thus better).
I find that I tend to design my protocol designs in such a way that I can use them with non-blocking sockets, just because I like working with non-blocking so much better.

Personally I use ICS when working with non-blocking sockets: http://www.overbyte.be/frame_index.html
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
In this article, I am going to show you how to simulate a multi-site Lab environment on a single Hyper-V host. I use this method successfully in my own lab to simulate three fully routed global AD Sites on a Windows 10 Hyper-V host.
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

695 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question