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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T10:21:11+00:00 2026-06-15T10:21:11+00:00

I have a apache server and listen to port 8000 and 80 i use

  • 0

I have a apache server and listen to port 8000 and 80

i use below php function to create a web socket

private function createSocket($host,$port)
{
    if( ($this->master=socket_create(AF_INET,SOCK_STREAM,SOL_TCP)) < 0 )
    {
        die("socket_create() failed, reason: ".socket_strerror($this->master));
    }

    self::console("Socket {$this->master} created.");

    socket_set_option($this->master,SOL_SOCKET,SO_REUSEADDR,1);
    #socket_set_option($master,SOL_SOCKET,SO_KEEPALIVE,1);

    if( ($ret=socket_bind($this->master,$host,$port)) < 0 )
    {
        die("socket_bind() failed, reason: ".socket_strerror($ret));
    }

    self::console("Socket bound to {$host}:{$port}.");

    if( ($ret=socket_listen($this->master,5)) < 0 )
    {
        die("socket_listen() failed, reason: ".socket_strerror($ret));
    }

    self::console('Start listening on Socket.');

    $this->allsockets[] = $this->master;
}

assume the $host is 127.0.0.1 and $port is 8000

when i go to shell console and start the socket server, it said Warning: socket_bind(): unable to bind address [98]: Address already in use

when i remove the $port, it doesnt show error, but the socket server keep listening and no response

What is the problem?

  • 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-15T10:21:12+00:00Added an answer on June 15, 2026 at 10:21 am

    Warning: socket_bind(): unable to bind address [98]: Address already in use

    This means that your server is already using the port that you selected. You’ll have to choose another port until you find one that is not in use.

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

Sidebar

Related Questions

I have a static Web project added to an Apache server. Whenever I make
I have set up an Apache server running locally that hosts my web application
I have an apache server on linux machine which listen at: http://:8080 it will
I have an apache web server running on my ubuntu server box. Recently, I
I'm currently using an Apache server with PHP to listen for requests from another
I have an Apache SSL connection available with a C# server that listens to
I installed XAMPP and have an apache server running. My files are located on
I'm trying to add Apache server to Eclipse(Juno). I have installed Apache server 7.0,
I have my Apache http server running on localhost:80 and restlet server on localhost:8182,
I have installed apache on my server however I can not browse my website

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.