package logserver { import flash.utils.ByteArray; import flash.events.*; import flash.net.Socket; public class WriteLog { private static var telnetClient:Telnet; public static function initialize(): void { telnetClient = new Telnet("localhost", 10515); } public static function log(mes:String): void { var ba:ByteArray = new ByteArray(); ba.writeMultiByte(mes + "\n", "UTF-8"); telnetClient.writeBytesToSocket(ba); //telnetClient.writeStringToSocket(mes + "\n"); } public static function dispose(): void { telnetClient.closeTelnet(); } } }