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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:09:25+00:00 2026-05-26T00:09:25+00:00

In php when you open a socket connection. you can do it like this:

  • 0

In php when you open a socket connection. you can do it like this:

$fp = @stream_socket_client ( $hosts, $errno, $errstr, 120, STREAM_CLIENT_CONNECT );

or this :

$fp = @fsockopen($Host , $Port, $errno, $errstr, 15);

then you want to get a file

We can do this with a various functions fgets fread stream_get _line etc

What is the best practice for get the better results and higher speed of transfer?

  • 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-26T00:09:25+00:00Added an answer on May 26, 2026 at 12:09 am

    This is largely subjective to your platform and configuration. Sockets will provide a very efficient transfer, but you’ll have to do all the HTTP/FTP request stuff yourself if you want to get a file.

    Your best bet is just to try them out yourself and see how it performs.

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

Sidebar

Related Questions

At the beginning of each PHP page I open up the connection to MySQL,
When I open a MySQL connection in PHP with just PHP's built-in MySQL functions,
I'm currently developing (another) Open Source CMS in PHP and I'd like to use
How can I open a web-page and receive its cookies using PHP? The motivation
with this cronjob: 0 * * * * usr/bin/open http://www.myurl.com/mypage.php I open this URL
I'm trying to open a socket on a host using the following code: $timeout
I'm using a socket connection in PHP to post data to an Apache webserver.
I am trying to open a socket and listen. Clients written in PHP will
In php I have open a .php file and want to evaluate certain lines.
My goal here is to open temp.php, explode by ### (line terminator), then by

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.