doukuipai8544 2013-07-31 13:23
浏览 56

在PHP服务器套接字编程中无法绑定相同的端口

I am trying to bind socket with same port, I am getting error.

socket_bind(): unable to bind address [0]: Only one usage of each socket address (protocol/network address/port) is normally permitted. in C:\xampp\htdocs\my\server.php on line 79 Could not bind to socket

Here is 79-th line:

$result = socket_bind($socket, $host, $port) or die("Could not bind to socket
");

How to fix this?

  • 写回答

2条回答

  • du2986 2013-07-31 13:35
    关注

    I am trying to bind socket with same port

    Use a different port or kill the application that is bound to the port you are trying to bind to. Generally speaking only 1 application can be bound to a port at a time.

    netstat -O is used to find ports that are in use via cmd in windows.

    评论

报告相同问题?

悬赏问题

  • ¥15 怎么获取下面的: glove_word2id.json和 glove_numpy.npy 这两个文件
  • ¥15 js调用html页面需要隐藏某个按钮
  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥20 java项目连接sqlserver时报ssl相关错误
  • ¥15 一道python难题3
  • ¥15 牛顿斯科特系数表表示
  • ¥15 arduino 步进电机
  • ¥20 程序进入HardFault_Handler
  • ¥15 oracle集群安装出bug