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 1008799
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T08:49:38+00:00 2026-05-16T08:49:38+00:00

Good Afternoon Gurus, I am pretty familiar with basic socket programming, and the IO::Socket

  • 0

Good Afternoon Gurus,

I am pretty familiar with basic socket programming, and the IO::Socket module but I need to code something now that I have not encountered before. It will be a 3 tier application. The first tier is an event-loop that sends messages upstream when certain events are encountered. The second tier is the ‘middle-ware’ server, which (among other things) acts as the message repository. The third tier is a cgi application, which will update a graphical display.

I am confused on how to set up the server to accept uni-directional connections from multiple clients one one side, and communicate bi-directionally with the cgi application on the other. I can do either of those tasks separately, just not in the same script (yet). Does my question make sense? I would like to stick with using the IO::Socket module, but it is not a requirement by any means. I am not asking for polished code, just advice on setting up the socket(s) and how to communicate from one client to another via the server.

Also, does it make more sense to have the cgi application query the server for new messages, or have the server push the new message upstream to the cgi application? The graphical updates need to be near real-time.

Thank you in advance,

Daren

  • 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-16T08:49:39+00:00Added an answer on May 16, 2026 at 8:49 am

    You said you already have an event loop in the first tier. In a way, your second-tier server should also arrange some kind of event loop for asynchronous processing. There are many ways to code it using perl, like AnyEvent, POE, Event to name just a few. In the end, they all use one of select, poll, epoll, kqueue OS facilities (or their equivalent on Windows). If you feel comfortable coding in a relatively low-level, you can just use perl’s select builtin, or, alternatively, its object-oriented counterpart, IO::Select.

    Basically you create two listening sockets (you might only need one if the first tier uses the same communication protocol as the third tier to talk to your server), add it to the IO::Select object and do a select on it. Once the connection
    is made, you add the accepted sockets to the select object.
    The select method of IO::Select will give you back a list of sockets ready for reading or writing (I am ignoring the possibility of exceptions here). Of course you have to keep track of your sockets to know which one is which. Also, the communication logic will be somewhat complicated because you have to use non-blocking sockets.

    As for the second part of your question, I am a little bit confused what you mean by “cgi” – whether it is a Common Gateway Interface (i.e., server-side web scripts), or whether it is a shorthand for “computer graphics”. In both cases I think that it makes sense for your task to use server push.
    In the latter case that’s all I’d like to say. In the former case, I suggest you google for “Comet” (as in “AJAX”). 🙂

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

Sidebar

Ask A Question

Stats

  • Questions 529k
  • Answers 529k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The Standard (ISO C++-03) says the following thing about references… May 16, 2026 at 11:22 pm
  • Editorial Team
    Editorial Team added an answer You have java API that can do that. I suggest… May 16, 2026 at 11:22 pm
  • Editorial Team
    Editorial Team added an answer Since System.Windows.Documents.Run and System.Windows.Documents.Span both derive from System.Windows.Documents.Inline it could… May 16, 2026 at 11:22 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

Good afternoon, This should be an easy one. I've done the cookie-cutter default ASP.NET
Good afternoon, I have a web query in Excel 2002 going against a web
Good afternoon, with all the buzz around the iPhone / AppStore etc, I felt
Good afternoon everyone, I am having an issue with a stored procedure inserting an
Good afternoon, i am currently wrestling with an old .dll which functionality I have
Good afternoon, I am having a little trouble with .net's internal (System.Drawing) based MetaFile
Good afternoon, I would ask some suggestion about the best way to monitor events
Good Afternoon, I'm currently planning a web-app/service project with a geolocation-enabled user model (lat/lng
Good Afternoon, My report's page size is 8.5 by 11 with .5in margins all
Good afternoon, I am currently in the very early phase of a new project

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.