//protected Queue<Tuple> tuple_queue = new Queue<Tuple>(); public void initialComponent(Conf config, Context context) { string information = StandardIO.readMsg(); InitialHandshake handshake = InitialHandshake.Parse(information); config = handshake.conf; context = handshake.context; int process_id = Process.GetCurrentProcess().Id; PID temp = new PID(); temp.pid = process_id; string json_pid = JsonMapper.ToJson(temp); try { string dir_path = @handshake.pidDir; System.IO.Directory.CreateDirectory(dir_path); string file = handshake.pidDir + @"\" + process_id.ToString(); if (!System.IO.File.Exists(file)) { System.IO.FileStream f = new System.IO.FileStream(file, System.IO.FileMode.CreateNew); } } catch (Exception e) { // do nothing } StandardIO.sendMsg(json_pid); }
private void initialComponent(Conf config, Context context) { string information = StandardIO.readMsg(); InitialHandshake handshake = InitialHandshake.Parse(information); config = handshake.conf; context = handshake.context; int process_id = Process.GetCurrentProcess().Id; PID temp = new PID(); temp.pid = process_id; string json_pid = JsonMapper.ToJson(temp); StandardIO.sendMsg(json_pid); string file = handshake.pidDir + "/" + process_id.ToString(); if (!System.IO.File.Exists(file)) { System.IO.FileStream f = new System.IO.FileStream(file, System.IO.FileMode.CreateNew); } }