闪存套接字服务器只适用于本地机器 [英] Flash socket server only works on local machine

查看:164
本文介绍了闪存套接字服务器只适用于本地机器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用PHP创建了一个基本的flash套接字服务器,在我的本地机器(无论是在浏览器还是在闪存沙箱里)都能正常工作,但是当我得到另一台机器连接到我的电脑的Site目录时,无法连接到服务器!



在flash中:

  mySocket.connect( 本地主机,9999); 

在PHP



  $ address ='127.0.0.1'; 
$ port = 9999;

我已经尝试将闪存代码更改为我的机器的IP,但没有任何客户端本地)可以连接。



请帮忙!
$ b


PS。在站点目录中的mac上运行。
我通过
终端(PHP 5)运行套接字服务器。我用perl运行策略文件服务器,但我不认为这是问题。

>127.0.0.1是回送接口的地址。它只能在同一台机器上使用。您需要监听所有接口(loopback,eth0等),将套接字绑定到0.0.0.0。


I have created a basic flash socket server in PHP, it all works fine on my local machine (both in the browser and in the flash sandbox) but as soon as I get another machine to connect to my computer's Site directory, they can't get a connection open to the server!

In flash:

mySocket.connect("localhost",9999);

In PHP

$address = '127.0.0.1';
$port = 9999;

I have tried changing the flash code to the IP of my machine but then none of the clients (including the local) can connect.

Please help!

PS. Running on a mac in the Sites dir. I am running the socket server through terminal (PHP 5). Am running a policy file server with perl but I don't think that is the problem

解决方案

"127.0.0.1" is the address for the loopback interface. It's only available on the same machine. You need to listen on all interfaces (loopback, eth0, etc) by binding the socket to "0.0.0.0".

这篇关于闪存套接字服务器只适用于本地机器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆