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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T17:48:32+00:00 2026-06-13T17:48:32+00:00

I need to make a script that is server and client at the same

  • 0

I need to make a script that is server and client at the same time.

This needs to alternate from listening to trying to connect.

Is there a way to temporarily block any client from connecting while it proceeds to client mode and attempts to connect?

As far as I have noticed there is only a permanent way to stop this that would involve starting to listen again and I am trying to avoid that.

The idea is that this will run on multiple servers and it will have to connect to itself.

Each time a connection is made each party removes the other from list of (clients/destinations) once they exchange what they need to exchange.

So I need a way to block the listener while it attempts a connection cause on rare occasions two attempt connection to each other at the exact same time and bought hang waiting to be picked up but that does not happen.

  • 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-13T17:48:33+00:00Added an answer on June 13, 2026 at 5:48 pm

    You could either do:

    • close() the listen socket (and maybe reopen it when needed)
    • if the listen socket becomes readable, don’t call accept() yet (you can get away with this for a few seconds, but it does use OS resources)
    • do call accept(), but immediately close() the resulting socket. (this is rather rude…)

    The above three options are from the systemcall/OS level. I don’t know how PHP implements (or wraps) them.

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

Sidebar

Related Questions

I need to make a script that will take files from a user and
I am trying to make a bash script that will transfer a file from
I need to make a proxy script that can access a page hidden behind
I need to make a bash script that takes user input and does some
I am trying to make a call with this script, but am getting a
I'm trying to make a script that telnet ip port to see if the
Well, I need to create hsqldb in server mode and connect to this server
I would like make a script using PHP (probably need JS) to send POST
I am working on a greasemonkey script for gmail where i need to make
I've got a small client/server test application where I have a Flex app that

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.