public LiaToolBox(String path) { try { clientChannel = new IpcClientChannel(); ChannelServices.RegisterChannel(clientChannel, false); RemotingConfiguration.RegisterWellKnownClientType(typeof(IPCRemoteObject), "ipc://LiaVM/lia"); obj = new IPCRemoteObject(); } catch (Exception e) { if (e != null) { MessageBox.Show("VM이 종료되어 있습니다."); Environment.Exit(2); } } String programWithExt = Path.GetFileName(path); if (Path.GetExtension(programWithExt) == "li") { MessageBox.Show("정상적인 파일이 아닙니다."); Environment.Exit(2); } this.programName = Path.GetFileNameWithoutExtension(programWithExt); setName(); readCode(path); LiaConsoleWriteLine("Applicatino is Launch"); }
static void openIPCServer() { IpcServerChannel svr = new IpcServerChannel("LiaVM"); ChannelServices.RegisterChannel(svr, false); RemotingConfiguration.RegisterWellKnownServiceType(typeof(IPCRemoteObject), "lia", WellKnownObjectMode.Singleton); Console.WriteLine("Listening on " + svr.GetChannelUri()); IPCRemoteObject ro = new IPCRemoteObject(new IPCCaller(ApplicationData.Instance.recordConsole)); ApplicationData.Instance.svr = svr; ApplicationData.Instance.ro = ro; }