Socket control with Indy9?

Posted on 2004-11-09
Last Modified: 2008-02-01
Is it possible to actually control connections at the socket level while using Indy 9 server components? If so, how? :)

What I wish is when a client tries to connect to, for example, an IdTelnetServer, is to allow or deny the connection based on an IP whitelist at the point of accepting the socket connection (similar to returning an INVALID_SOCKET with a WSAECONNREFUSED error from a WSAAccept call? )

Accepting the connection and then disconnecting is not appropriate.

Question by:dmasque
    1 Comment
    LVL 5

    Accepted Solution


    If you look at the OnConnect event, you can see a TIdPeerThread parameter.
    It has a "socket" property that you can use.

    Have fun :-)



    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Suggested Solutions

    A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
    Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    754 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

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now