コード例 #1
0
ファイル: IpcPath.cs プロジェクト: paulhwang/phwang_ipc
        public int AllocPath(NetworkStream stream_var)
        {
            IpcPathEntryClass path = new IpcPathEntryClass();

            path.TcpStream = stream_var;

            for (int i = 0; i < this.PATH_ARRAY_LENGTH; i++)
            {
                if (this.PathEntryArray[i] == null)
                {
                    this.PathEntryArray[i] = path;
                    return(i);
                }
            }

            return(-1);
        }
コード例 #2
0
ファイル: IpcPath.cs プロジェクト: paulhwang/phwang_ipc
        public string ReceiveData(int path_id_var)
        {
            IpcPathEntryClass path_entry = GetPath(path_id_var);

            if (path_entry == null)
            {
                Utilities.DebugClass.AbendIt("ReceiveData", "null path_entry");
                return(null);
            }

            NetworkStream stream = path_entry.TcpStream;

            if (stream == null)
            {
                Utilities.DebugClass.AbendIt("ReceiveData", "null stream");
                return(null);
            }

            string data = this.IpcTcp().TcpReceiveData(stream);

            return(data);
        }
コード例 #3
0
ファイル: IpcPath.cs プロジェクト: paulhwang/phwang_ipc
        public void TransmitData(int path_id_var, string data_var)
        {
            IpcPathEntryClass path_entry = GetPath(path_id_var);

            this.IpcTcp().TcpTransmitData(path_entry.TcpStream, data_var);
        }