Пример #1
0
        public static void RunAsServer(object ip_addr_port_var)
        {
            IpAddrPort ip_addr_port = (IpAddrPort)ip_addr_port_var;

            IpcBaseClass ipc_base = new IpcBaseClass();
            IpcApiClass  ipc_api  = ipc_base.IpcApi;

            int path_id = ipc_api.ApiTcpServer(ip_addr_port.IpAddr, ip_addr_port.Port);

            if (path_id == -1)
            {
                return;
            }

            while (true)
            {
                string data = ipc_api.ApiTcpReceiveData(path_id);
                //this.debugIt(true, "TestServer receive:", data);
                //Thread.Sleep(100);
            }
        }
Пример #2
0
        public static void RunAsClient(object ip_addr_port_var)
        {
            IpAddrPort ip_addr_port = (IpAddrPort)ip_addr_port_var;

            IpcBaseClass ipc_base = new IpcBaseClass();
            IpcApiClass  ipc_api  = ipc_base.IpcApi;

            int path_id = ipc_api.ApiTcpClient(ip_addr_port.IpAddr, ip_addr_port.Port);

            if (path_id == -1)
            {
                //this.debugIt(true, "TestClient", "***** path_id == -1");
                return;
            }

            Thread.Sleep(1000);
            for (int i = 0; i < 5; i++)
            {
                ipc_api.ApiTcpTransmitData(path_id, "hello from phwang");
            }
        }
Пример #3
0
 public IpcApiClass(IpcBaseClass base_var)
 {
     this.IpcBase = base_var;
 }
Пример #4
0
 public IpcPathClass(IpcBaseClass base_var)
 {
     this.IpcBase        = base_var;
     this.PathEntryArray = new IpcPathEntryClass[this.PATH_ARRAY_LENGTH];
 }