<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: XMLSocket.send / Socket.writeUTFBytes doesn&#8217;t work?</title>
	<atom:link href="http://gruchalski.com/2009/06/11/xmlsocket-send-socket-writeutfbytes-doesnt-work/feed/" rel="self" type="application/rss+xml" />
	<link>http://gruchalski.com/2009/06/11/xmlsocket-send-socket-writeutfbytes-doesnt-work/</link>
	<description>just another blog in all that noise...</description>
	<lastBuildDate>Thu, 12 Jan 2012 21:23:05 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Nick</title>
		<link>http://gruchalski.com/2009/06/11/xmlsocket-send-socket-writeutfbytes-doesnt-work/comment-page-1/#comment-47325</link>
		<dc:creator>Nick</dc:creator>
		<pubDate>Wed, 26 Oct 2011 04:15:43 +0000</pubDate>
		<guid isPermaLink="false">http://gruchalski.com/?p=298#comment-47325</guid>
		<description>I hope you don&#039;t mind, but thought it might be useful to leave this here for others (found your post when looking for help) - I had a similar problem without the involvement of Java; just listening with netcat, couldn&#039;t seem to write to the AS3 socket.

My problem was that I wasn&#039;t waiting for successful connection before writing to the socket. Code I needed looked like (where s is my Socket):

s.addEventListener(flash.events.Event.CONNECT, onConnect);

then
                private function onConnect(event:Event):void {
                        if(s.connected) {
                                textOut.appendText(&quot;connected&quot;);
                                s.writeUTF( &quot;SUP ...&quot;);
                                s.flush();
                        }
                }</description>
		<content:encoded><![CDATA[<p>I hope you don&#8217;t mind, but thought it might be useful to leave this here for others (found your post when looking for help) &#8211; I had a similar problem without the involvement of Java; just listening with netcat, couldn&#8217;t seem to write to the AS3 socket.</p>
<p>My problem was that I wasn&#8217;t waiting for successful connection before writing to the socket. Code I needed looked like (where s is my Socket):</p>
<p>s.addEventListener(flash.events.Event.CONNECT, onConnect);</p>
<p>then<br />
                private function onConnect(event:Event):void {<br />
                        if(s.connected) {<br />
                                textOut.appendText(&#8220;connected&#8221;);<br />
                                s.writeUTF( &#8220;SUP &#8230;&#8221;);<br />
                                s.flush();<br />
                        }<br />
                }</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan</title>
		<link>http://gruchalski.com/2009/06/11/xmlsocket-send-socket-writeutfbytes-doesnt-work/comment-page-1/#comment-23275</link>
		<dc:creator>Dan</dc:creator>
		<pubDate>Tue, 19 Apr 2011 14:45:35 +0000</pubDate>
		<guid isPermaLink="false">http://gruchalski.com/?p=298#comment-23275</guid>
		<description>Was just wondering if anyone could help me with multithreading, in regards to this server how would I allow connections from more than one client at a time?
I believe this is an old post, but it is very useful in dealing with policy files.

Dan</description>
		<content:encoded><![CDATA[<p>Was just wondering if anyone could help me with multithreading, in regards to this server how would I allow connections from more than one client at a time?<br />
I believe this is an old post, but it is very useful in dealing with policy files.</p>
<p>Dan</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: java and flash - Java Forums</title>
		<link>http://gruchalski.com/2009/06/11/xmlsocket-send-socket-writeutfbytes-doesnt-work/comment-page-1/#comment-23130</link>
		<dc:creator>java and flash - Java Forums</dc:creator>
		<pubDate>Mon, 18 Apr 2011 15:55:02 +0000</pubDate>
		<guid isPermaLink="false">http://gruchalski.com/?p=298#comment-23130</guid>
		<description>[...]  [...]</description>
		<content:encoded><![CDATA[<p>[...]  [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan</title>
		<link>http://gruchalski.com/2009/06/11/xmlsocket-send-socket-writeutfbytes-doesnt-work/comment-page-1/#comment-22338</link>
		<dc:creator>Dan</dc:creator>
		<pubDate>Mon, 11 Apr 2011 15:08:33 +0000</pubDate>
		<guid isPermaLink="false">http://gruchalski.com/?p=298#comment-22338</guid>
		<description>Thankyou so much, this is just what ive been looking for.

Had so much trouble with the new flash security methods and policy files.

Dan</description>
		<content:encoded><![CDATA[<p>Thankyou so much, this is just what ive been looking for.</p>
<p>Had so much trouble with the new flash security methods and policy files.</p>
<p>Dan</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: eracer</title>
		<link>http://gruchalski.com/2009/06/11/xmlsocket-send-socket-writeutfbytes-doesnt-work/comment-page-1/#comment-16046</link>
		<dc:creator>eracer</dc:creator>
		<pubDate>Mon, 07 Feb 2011 10:42:03 +0000</pubDate>
		<guid isPermaLink="false">http://gruchalski.com/?p=298#comment-16046</guid>
		<description>This is actually the ONLY Java version of a Flash XMLSocket-compatible server I could find accross the web.
It is absolutely mandatory to avoid any &quot;Buffered*&quot; reader of writer class in Java because they add some delay and Flash does not wait for that, it justs spoils the attempt. 
I found that with wireshark.

My policy file is 
							msg = &quot;&quot;
								+ &quot;&quot;
								+ &quot;&quot;
								+ &quot;&quot;;

The null byte is mandatory as well  : out.write((byte)0);

Thanks Man !</description>
		<content:encoded><![CDATA[<p>This is actually the ONLY Java version of a Flash XMLSocket-compatible server I could find accross the web.<br />
It is absolutely mandatory to avoid any &#8220;Buffered*&#8221; reader of writer class in Java because they add some delay and Flash does not wait for that, it justs spoils the attempt.<br />
I found that with wireshark.</p>
<p>My policy file is<br />
							msg = &#8220;&#8221;<br />
								+ &#8220;&#8221;<br />
								+ &#8220;&#8221;<br />
								+ &#8220;&#8221;;</p>
<p>The null byte is mandatory as well  : out.write((byte)0);</p>
<p>Thanks Man !</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: LordCover</title>
		<link>http://gruchalski.com/2009/06/11/xmlsocket-send-socket-writeutfbytes-doesnt-work/comment-page-1/#comment-3286</link>
		<dc:creator>LordCover</dc:creator>
		<pubDate>Fri, 15 Jan 2010 11:49:18 +0000</pubDate>
		<guid isPermaLink="false">http://gruchalski.com/?p=298#comment-3286</guid>
		<description>Hey, very helpful since this policy thing is really a damn.

I will try that, thanks.</description>
		<content:encoded><![CDATA[<p>Hey, very helpful since this policy thing is really a damn.</p>
<p>I will try that, thanks.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

