Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7624313
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T04:55:48+00:00 2026-05-31T04:55:48+00:00

Specialized Server provides four interfaces to connect – HTTP, HTTPS, Telnet and SSH. We

  • 0

Specialized Server provides four interfaces to connect – HTTP, HTTPS, Telnet and SSH. We have a specific priority to connect with the server. e.g. Following sequence to be followed to connect to the server – HTTPS, HTTP, Telnet and SSH. It means that first the client will try to connect with HTTPS. If it fails then it will retry it again with HTTPS. If this fails again then it will try with HTTP and so on. I will get the respective connection object one’s it will success. e.g. if connection with HTTP get success then it will return an HTTP connection object.

Can you please help me to findout any pattern which can be helpful here?

Currently I am thinking to implement it using proxy. I will have a ConnectionProxy Class and this class will find the first successful connection protocol.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T04:55:50+00:00Added an answer on May 31, 2026 at 4:55 am

    I’m not sure the difference between a ConnectionProxy and a Connection object. The Connection objects should have a standard interface to allow them to be used interchangeably and implementations which specify their differences.

    “Interfaces” in Perl are lightweight. They’re just a formulation of expectations that an object would have to fulfill in order to say that the object DOES that role.

    As for a simplest implementation of a Connection factory

    use English qw<$EVAL_ERROR>;
    ...
    foreach my $con_class (
        qw<
        Connection::HTTPS 
        Connection::HTTP 
        Connection::Telnet 
        Connection::SSH
        > ) { 
        my $conn;
        eval { $conn = $con_class->new( HostAndPort => '127.0.0.1:21' ); };
        return $conn if $conn && !$EVAL_ERROR;
        $logger->error( $EVAL_ERROR );
    }
    

    Now, I would tend to keep the list of connection classes in some configuration somewhere (preferably YAML, for me). But again, this is the simplest implementation of a fail-over.

    Just mainly as a development issue, I find it is useful to have generic tests for each interface. If you say Class C DOES Interface I, the generic test can verify this fact before you add it to the list of available interface implementations. The test can verify the same things that a compiler can–and more.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For work I have written a specialized HTTP server which only performs 301/302/Frame redirections
I need to create specialized HTTP server, for this I plan to use epoll
I wrote a small program, kind of specialized HTTP server in haskell, which is
I have a specialized list that holds items of type IThing : public class
For a specialized purpose with Aweber regarding a newsletter subscription, I have a page
I'm having some problems with deserializing an object. I have following classes: Metadatastore: [DataContract]
I want to have an abstract class Server with an abstract method called Initialize
I've written a specialized JSON-RPC server and just started working my way up into
I have a development team specialized in ASP.NET. So the solutions we provide are
I have a pretty complex form that provides real-time validation and feedback to the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.