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

  • Home
  • SEARCH
  • 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 760705
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T15:45:00+00:00 2026-05-14T15:45:00+00:00

I have a 3rd-party protocol module (SNMP) that is built on top of asyncore.

  • 0

I have a 3rd-party protocol module (SNMP) that is built on top of asyncore. The asyncore interface is used to process response messages. What is the proper technique to design a client that generate the request-side of the protocol, while the asyncore main loop is running. I can think of two options right now:

  1. Use the loop,timeout parameters of asyncore.loop() to allow my client program time to send the appropriate request.

  2. Create a client asyncore dispatcher that will be executed in the same asyncore processing loop as the receiver.

What is the best option? I’m working on the 2nd solution, cause the protocol API does not give me direct access to the asyncore parameters. Please correct me if I’ve misunderstood the proper technique for utilizing asyncore.

  • 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-14T15:45:00+00:00Added an answer on May 14, 2026 at 3:45 pm

    I solved this by adding a callback function into the asyncore loop for the receiver process.

    The solution was somewhat specific to the module I was experiment with (pySNMP), but here is the general idea:

    1. define a function closure that returns a callable method with a stored reference to a dict and window variable. The dict tracks the expected responses, and the window is the size of the sender buffer.

    2. pass a reference to the closure function into a customized asyncore.dispatcher instance. The callback function can be executed in the writeable method invocation.

    3. set the timeout of the dispatcher to a small value. This prevents asyncore from blocking for too long, while waiting for received packets. I used .05 seconds. The lower you go, the more response your app is, but don’t go too low.

    4. update the asyncore read_handle method to remove the received responses from your global dict structure. This will allow new messages to be transmitted.

    5. now kick-off the dispatcher and every loop of the asyncore, the system will call the callback function, and send any messages, up to the defined window size.

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

Sidebar

Related Questions

so I have a 3rd party application that I have to interface with, this
I have 3rd party libraries for my mac applications which used to link nicely
I have a 3rd Party tool that generates an xml spreadsheet (*.xls). I have
I have a 3rd party JAR that I have converted to an OSGI bundle
I have a 3rd party struct that is comprised of the following: [StructLayout(LayoutKind.Sequential, Size=1)]
I have a 3rd party web page screen capture DLL from http://websitesscreenshot.com/ that lets
I have a 3rd party app that does a database export in to a
I have a 3rd party library that's written in C. It exports all of
I have a 3rd party non-signed assembly that I want to reference in several
I have a 3rd party .dll that I have successfully added as a reference

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.