/// <summary> /// 初始化SOCKET /// </summary> private void InitSocket(string ip, int port) { try { ip = System.Net.Dns.GetHostAddresses(ip)[0].ToString(); } catch { } try { commandPool = new CommandPool(loginInfo); commandPool_back = new CommandPool(loginInfo); socket = new MyTcpIpClient(loginInfo); socket.Error += new ErrorEvent(socket_Error); socket.Incept += new InceptEvent(socket_Incept); socket.TcpIpServerIP = ip; socket.TcpIpServerPort = port; socket.Conn(); socket.SendPassport(loginInfo.b2b.lr.PASSPORT); uploadEticketInfo = new UploadEticketInfo(socket, commandPool_back, loginInfo); } catch (Exception ex) { AppendBlackWindow("初始化SOCKET失败 Address=" + ip + "::" + port.ToString() + ": " + ex.Message); } try { finance.autoImport.set_args_constructor(socket, loginInfo, commandPool); } catch { } }
public UploadEticketInfo(MyTcpIpClient sk, CommandPool pool_background, LoginInfo li) { fc = new EagleWebService.kernalFunc(li.b2b.webservice); m_socket = sk; m_pool = pool_background; m_li = li; file = Application.StartupPath + "\\4ULticket.txt"; ls_pnr = new List <string>(); try { string[] a = File.ReadAllLines(file); foreach (string s in a) { ls_pnr.Add(s); } File.WriteAllText(file, ""); } catch { } }
public void set_input_args(MyTcpIpClient socket, LoginInfo li, CommandPool pool) { m_socket = socket; m_li = li; m_pool = pool; }
// Use this for initialization void Start() { client = new MyTcpIpClient(); client.Connect(); }
public EasyMain(MyTcpIpClient socket, LoginInfo li, CommandPool pool) { InitializeComponent(); set_input_args(socket, li, pool); InitForm(); }