XMLSocket 可以接收数据但不能发送
我正在尝试使用 XMLSocket 连接到带有 Flash 的 python 扭曲套接字服务器。连接工作正常,接收也正常。但是我无法将数据发送到服务器。
我应该使用特定的格式吗?我问的原因是因为我无法使用 XMLSocket 读取任何数据,直到数据采用“something\0”形式,也就是说,数据字符串必须是有效的 xml 后跟空字符。发送数据有什么技巧吗?
我不认为这是一个跨站点安全问题,因为如果是的话,我相信我将无法连接或接收。
我可以使用 telnet 和 java 客户端连接到服务器,没有任何问题。
编辑:我发现了,问题是我的服务器需要将发送到它的数据以“\r\n”结尾。
I am attempting to connect to a python twisted socket server with Flash using XMLSocket. The connect works fine, and so does the receive. However I can't send data to the server.
Is there a specific format I should be using? The reason I ask is because I couldn't read any data with the XMLSocket until the data was in the form "something\0", that is, the data string had to be valid xml followed by the null character. Is there a trick to sending data?
I don't think this a cross site security problem, because if it was, I believe I wouldn't be able to connect or receive.
I am able to connect to the server using telnet and a java client without issues.
EDIT: I figured it out, the problem was my server needed to have the data sent to it end with "\r\n".
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
要使用 XMLSocket 类,服务器计算机必须运行一个能够理解 XMLSocket 类使用的协议的守护程序。以下列表中描述了该协议:
To use the XMLSocket class, the server computer must run a daemon that understands the protocol used by the XMLSocket class. The protocol is described in the following list: