~eda-qa/dhlib/main

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/* <license>
 * This file is part of the dis-Emi-A HaXe Library. Copyright © edA-qa mort-ora-y
 * For full copyright and license information please refer to doc/license.txt.
 * </license> 
 */
import flash.events.Event;

class SocketTest
{
	static var q : flash.net.Socket;
	
	static public function main()
	{
		//HAXE: how to do cross-platform simple socket communications?
		q = new flash.net.Socket( "localhost", 10001 );
		q.addEventListener(Event.CONNECT, connectHandler);
		
		//q.close();
	}
	
	static function connectHandler( event : Event )
	{
		for(  i in 0...100 )
			q.writeUTFBytes( "Söme string €\n" );
		q.flush();
	}
}