我尝试使用adobeflash客户端和python服务器之间的套接字发送和获取数据。 Flash客户端:
var serverURL = "se.rv.er.ip";
var xmlSocket:XMLSocket = new XMLSocket();
xmlSocket.connect(serverURL, 50007);
xmlSocket.addEventListener(DataEvent.DATA, onIncomingData);
function onIncomingData(event:DataEvent):void
{
trace("[" + event.type + "] " + event.data);
}
xmlSocket.send("Hello World");
和python服务器:
^{pr2}$但是这个代码不起作用。 Python服务器输出:
Connected by ('cl.ie.nt.ip', 3854)
Received '<policy-file-request/>\x00'
received policy
如果不需要,就不应该使用套接字模块。当你需要的时候,使用SocketServer,嗯,一个套接字服务器。在
应该是这样的。。在
相关问题 更多 >
编程相关推荐