問題タブ [xmlsocket]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票する
1 に答える
710 参照

android - Android の ActionScript ソケット

ActionScript で記述された Flash クライアント アプリケーションがあります。このアプリケーションは、XMLSocket クラスを使用してポート 5750 で TCP/IP 経由でサーバー デバイスと通信します。したがって、たとえば、ブラウザで Flash クライアントを実行し、サーバーに接続することができます。インターネット上にあります。

Android の最近のバージョンでは Flash がサポートされているため、Android デバイスに Flash クライアントをインストールすると、これが機能することが期待できます。ただし、接続の試行はハングするだけです。現在、クライアント側には診断はありません。実行中の Flash アプリケーションだけです。したがって、ログや標準エラー メッセージはありません。

サーバー デバイスは基本的にブラック ボックスですが、サーバーがクライアントからの要求を取得しないことは明らかです。これは、クライアントがソケットを開くことができなかったことを示しています。

基本的な Web 検索では、この状況についてあまり知られていないことがわかります。ここで何がうまくいかないのかについて何か考えはありますか?

たとえば、XMLSocket は Android では動かないのでしょうか? または、Android がポート 5750 をブロックしますか? または、Flash Player には何らかのサンドボックスまたはファイアウォールの制限が組み込まれていますか?

Android 2.2 ~ 2.3 および Android Flash Player 10 ~ 11 を実行するいくつかの異なる Android デバイスを試しました。クライアントは ActionScript 2 で記述されています。

0 投票する
3 に答える
161 参照

flash - フラッシュxmlsocket接続ホストには専用IPが必要ですか?

xmlsocketフラッシュベースのゲーム用にホストを準備したいのですが、この場合は経験がありません。専用のIPが必要ですか、それとも共有IPアドレスでxmlソケットを実行できますか?

0 投票する
1 に答える
361 参照

java - ソケットを使用してAndroidアプリ(Flex付き)をJavaサーバーに接続しますか?

複数のユーザーがローカルネットワーク上でホストされているサーバーにログインするアプリを作成しようとしています。Flash Builderでアプリをテストすると接続されますが、携帯電話で実行すると接続されません。

私は次のようにXMLSocketを使用しています:

ポリシーファイルについてはよくわかりません。何かができることを期待して、そこにファイルを入れました。

これが私の意味を説明するビデオです

0 投票する
0 に答える
594 参照

javascript - xmlsockets を使用してソケットに接続しようとすると、「オブジェクト # has no method 'SetVariable'"

Im trying to connect to a tcp socket using xmlsocket:

    var xmls = new XMLSocket();

    function connect() {
        xmls.onConnect = functi

Im trying to connect to a tcp socket using xmlsocket:

but when the browser tries to perform xmls.connect I get the exception:

Uncaught TypeError: Object # has no method 'SetVariable' __XMLSocket.connect

I guess because it tries to do:

I tried to find the problem but I can't find something about it and Im clueless with flash. any ideas?


I am not experienced in Javascript, just starting to understand how to think it should be used, so my opinion should not carry the same weight as that of someone who is experienced in the specific language. I would be interested in responses to my idea.

I have been experimenting with a style of defining class-like objects that depends on the Javascript with statement. I submit that this is a legitimate use.

Each class-like object in this style functions as a factory for objects to satisfy some purpose.

This style does not make use of the this keyword in instance methods.

This style conceives that each object generated out of one of these class-like objects is to have a public aspect and a private aspect. A Javascript object represents each of these aspects. Holders of references to the object actually only refer to the public aspect. The methods, however, know both aspects and I implement this with closures.

I do not pretend that this style is applicable to cases where we care much about runtime time or memory performance. I deliberately sacrifice quite a bit of each of those to programming efficiency. I expect to find plenty of cases where I want to program something quickly and with little chance of error, and where the demands at runtime will not be critical.

Since I have been trying code in a browser rather than node.js, a practical consideration of the development environment for me is that syntax errors in a large source file can be hard to pin down and correct. I counter this problem by adding code in small increments. Therefore, I want the class-like objects to be able to accept an instance method definition at a time, rather than requiring that all method definitions appear in one source file.

I declare a class-like object initially without any instance methods defined in it, and I place the class-like object in whatever namespace I am programming in.

Then I call the class-like object repeatedly at a method in it called "init" and each time, I pass an initializer, a function to be called during the initialization of an instance.

Eventually when I start using the class-like object as a factory for its instances, whenever I ask it for a new instance, it creates the public and private aspects for the instance, links the private aspect to the public one, then calls all the initializers that have been defined, passing to them the private aspect of the new instance.

In my style, every public attribute is a method. All variables whose values will not be functions should live on the private side.

One thing an initializer can do is establish a variable on the private side.

Another thing an initializer can do is to add a method either on the public or the private side.

Order matters for executing the initializers -- the class-like object is required to execute them in the same order in which they are defined. Consequently, each initializer can count on the public and private aspects of the instance having the attributes that were established by the earlier initializers. For the programmer, this creates in effect a pair of lexical scopes, since the initializers are not established by conditional or dynamic code of any kind; they are established as the source files are executed by the browser right after it reads and parses them.

Now in some languages, specifically the Ruby language and the Self language, you can write a naked identifier and have it interpreted as a method call on the current object. So in Ruby, "foo" can mean "self.foo" and in Self, "foo" can mean "self foo" (the syntax of method call differs between these languages, but up to the level of detail at which I am speaking of the semantics now, "self.foo" in Ruby and "self foo" in Self are the same). This abbreviation out of existence of "self" is particularly convenient for calling private methods and instance variables. The Javascript language does not provide this convenience.

In contexts inside an instance method where I want to use an attribute of the private or public side for its value (note, not on the left-hand side of an assignment), I like the convenience of referring to the attribute by just its name and not having to write "vars." or "self." to the left of it to locate it (I use "vars" for the private aspect and "self" for the public aspect). For this reason, I wrap each initializer in a Javascript with statement. This seems legitimate to me, because in my style, the population of the targeted object is lexically established. To see the attributes, the programmer needs only to look at the initializers provided earlier in the source files to the same class-like object (which is itself identified by name in the source code, so for software-engineering purposes we can regard it as a lexical entity, even though none of the Javascript parsers detect this).

0 投票する
1 に答える
1137 参照

flash - XMLSocket「ポリシーファイルのロードに失敗しました」エラー

XMLSocket.swfファイルを使用しようとしていますが、接続されていません。サーバーでポートを開く必要がありますか?これを専用のリモートWindows2008サーバーで実行しようとしています。

FlashFirebugからのエラーは次のとおりです。

crossdomain.xmlはWebディレクトリのルートに保存され、次のようになります。

0 投票する
0 に答える
657 参照

apache-flex - AS3 XMLSocket がクライアント側の切断を検出できない

Flex アプリケーション (AIR ではなく Flash プレーヤー) 内で XMLSocket を実行していますが、私の人生では、クライアント側の切断を検出する方法がわかりません。のように、コンピューターからリモートサーバーに接続し、コンピューターをインターネットから切断すると、ソケットはまだ接続されていると認識します (IOError またはクローズイベントがスローされません)。私のソケットクラス内では、接続が切断されると XMLSocket.send() で IOError が検出されることを期待して、2 秒ごとにメッセージをソケットに送信するようにしていますが、これでも機能しません! それでもデータを送信しようとし、例外をスローしませんが、確かに失敗しています。

インターネット接続が確立されている場合、リモート サーバーのソケット サーバーは Flex クライアントからのメッセージを取得します。

SocketMonitor と URLMonitor を調べましたが、これらは AIR でのみ使用でき、Flash Player では使用できません。

私が理解していないソケットについて何か基本的なことがあると思います。誰でも助けることができますか?

0 投票する
1 に答える
1795 参照

java - Javaソケットサーバー

私はすでにそれを失っています...

FlashDevelop(AS3)を介して単純なFlashアプリケーションを構築し、それをサーバーと通信させたい。次に、次のコードを使用して単純なSocketJavaアプリケーションを作成しました。

Main.java:

およびxSocketDataHandler.java:

したがって、問題は次のとおりです。

Javaアプリケーションを起動すると、完全に実行されます。Flashアプリケーションを起動すると、実行され、ソケットオブジェクトが作成され、サーバーに接続されます(すべてコンピューター内にあります)。サーバーは接続を試行しますが、次の場合に実行されます。

nbcが閉じていることを示し、サーバーは例外をキャッチします。 "onData: channel is closed (read buffer size=0)"

なぜ私がいつもこれを手に入れるのか誰かが知っていますか?どのように記述しても、Socket、XMLSocket、xSocketDataHandlerなどを使用しても、クローズドチャネルエラーが発生し続けます。

私は何が間違っているのですか?

ありがとう。

編集1:

AS3コード:

これは私のSocketクラスです:

0 投票する
1 に答える
536 参照

actionscript-3 - Flash が XMLSocket をセットアップできません

フラッシュでプロジェクトを開始しましたが、XMLSocket を起動できません。

私のコード:

パッケージ Network クラス CommunicationBootstrap:

私のエラーは何ですか: ioErrorHandler: [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2031: Socket Error. URL: 127.0.0.1"] securityErrorHandler: [SecurityErrorEvent type="securityError" bubbles =false cancelable=false eventPhase=2 text="エラー #2048: セキュリティ サンドボックス違反: file:///C|/Users/iufrs/Documents/AS3/1/Torn.swf は 127.0.0.1:30000 からデータを読み込めません。 "]

(トレースと 2 つのイベントで取得)

0 投票する
1 に答える
117 参照

actionscript-3 - AS3、xmlSocket、エンコーディング

私は作業しxmlSocketていますが、エンコーディングの問題があります (と思います)。Flash Builder でevent.dataプロパティをトレースするとデータが期待どおりに表示されますが、デバッグすると認識されない文字が多数表示されます。

画像を参照してください:

ここに画像の説明を入力

画像

使用するAlert.show()と、これらの認識されない文字が表示され、部分文字列メソッドと文字列メソッドを使用するときにも問題が発生します。

当然、トレースのバージョンで作業したい...

エンコードの問題…?それを解決する方法? byteArray を使用しようとしましたが、成功しませんでした。

注意: ソケット サーバー コードを変更したり、表示したりすることはできません。

ありがとう

0 投票する
1 に答える
301 参照

python - Flash クライアント XMLsocket が Python サーバーに接続できない

次のように、XMLsocketを使用してpythonサーバーに接続するフラッシュクライアントがあります。

このpythonスクリプトを使用してセキュリティファイルを送信します

これを使用して、クライアントからメッセージを受信します。

これらのスクリプトを実行すると、security.py が次のように出力されます。

しかし、server.py はこれ以外には何も出力しません:

そしてフラッシュのデバッグは何も出力しません

フラッシュはセキュリティ ファイルを正常に受信したようですが、XMLsocket.connect は失敗しましたか?