Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Are Indy components based on blocking sockets?

Posted on 2009-05-14
5
Medium Priority
?
502 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 500 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 500 total points
ID: 24383419
0
 
LVL 12

Assisted Solution

by:Hypo
Hypo earned 500 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 500 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Most of the applications these days are on Cloud. Cloud is ubiquitous with many service providers in the market. Since it has many benefits such as cost reduction, software updates, remote access, disaster recovery and much more.
This month, Experts Exchange’s free Course of the Month is focused on CompTIA IT Fundamentals.
Viewers will learn how to connect to a wireless network using the network security key. They will also learn how to access the IP address and DNS server for connections that must be done manually. After setting up a router, find the network security…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Suggested Courses

596 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