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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T21:20:33+00:00 2026-06-01T21:20:33+00:00

I writing php script that communicates with the server over unix local sockets. 1)

  • 0

I writing php script that communicates with the server over unix local sockets.
1) connect
2) send msg with socket_write() (90% of time low-size blocks, 10% big size)
3) get the answer
4) close connection

Now, I have simple socket_write() implementation like suggested at comments from php manual “jean at briskula dot si 03-Feb-2011 03:00”

Seems its work fine on blocking mode, but I want to implement timeouts for socket_write, therefore I think (need) to use non-blocking mode, when socket_write() called.

Is there any advantages of blocking mode over non-blocking?
Is there a reason to realize timeouts?
How to realize them correctly?
Any examples?

Tried to write on a while circle, but got ===FALSE, maybe need to socket_select() every time before socket_write() called?

ps. this question also actual for socket_read() when reading answer from server

  • 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-01T21:20:35+00:00Added an answer on June 1, 2026 at 9:20 pm

    For a PHP (web-facing) script sending data to/receiving data from a backend system through sockets without the chance for other processing in the meantime (which is basically why you’d want to use non-blocking mode in the first place), there’s no sense in handling the complications that non-blocking mode causes.

    So, stick with blocking mode.

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

Sidebar

Related Questions

I am writing a PHP script that will send via a cron an email
I'm writing a PHP script that autoconfigures a device over Telnet, and I need
I am writing a PHP script that will launch a program on the server.
I'm writing a PHP script that does a lot of repetitive work, and when
I'm writing a PHP script that downloads a series of generated files (using wget
I'm writing a PHP script that builds an SQL query by concatenating the string
I was thinking of writing a PHP script that would analyse a CMS'd page's
I'm writing a script in PHP that compares people together based on the number
I'm writing a php script that takes some c code and tests it against
I'm currently writing a PHP script that 3rd party clients will 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.