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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T15:38:29+00:00 2026-06-14T15:38:29+00:00

I created DNS proxy in C like this: socket – create socket to serve

  • 0

I created DNS proxy in C like this:

"socket" - create socket to serve client
"bind" - bind that socket
while (true) {
    "recvfrom" - a package from socket 
    "socket" - create socket for dns server
    (1)
    "sendto" - send package to dns server
    "recvfrom" - respond from dns server
    "sendto" - send respond to client
}

It’s working. But what if I get another request when I am at position (1)? How can I add some queue with waiting requests? How to change this that I serve every request even if I am working on another?

  • 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-06-14T15:38:30+00:00Added an answer on June 14, 2026 at 3:38 pm

    You need to listen() on the server socket, and listen allows you to specify a backlog of connections. You will be able to handle up to that number of new client arrivals per cycle.

    Then you cyclically run select() on the server socket and any outstanding client sockets, maintaining a list of them:

       select(nfds, readfds, writefds, errorfds, timeout);
    

    when select exits (unless it’s timed out) you will inspect the three return lists and handle any sockets ready for reading, writing, or in error state, and dispatch them appropriately.

    You will find a detailed example here (it’s for Linux, but easily portable).

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

Sidebar

Related Questions

We noticed that a hacker created a domain and configured DNS to point it
Need to create a custom DNS name server using C which will check against
I want to encode DNS protocol header using C and create a UDP datagram.
I've got a site www.example.com on one server. I'd like to create www.example.com/blog on
I created a WCF SOAP service using VS 2008 that works server side. I
I have the following model class DNS(models.Model): domain = models.ForeignKey(Domain) host_start = models.CharField(max_length=150, blank=True,
So I have this Windows service created in VB.Net, and all it does is
i'm trying to get CFHTTP to talk to a domain that i have created
I've created a Apache virtual host for a Amazone EC2 private DNS. Just the
I am trying to create some Apache rewrite rules that shall be able to

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.