コード例 #1
0
        public string GetFileSizeString(string dfsfile)
        {
            ensureconnected();

            netstm.WriteByte((byte)'s');
            XContent.SendXContent(netstm, dfsfile);
            ensurenextplus();
            string ssize = XContent.ReceiveXString(netstm, buf);

            return(ssize);
        }
コード例 #2
0
        void ensurenextplus()
        {
#if DEBUG
            ensureconnected();
#endif
            int ib = netstm.ReadByte();
            if ('+' != ib)
            {
                if ('-' == ib)
                {
                    string errmsg = XContent.ReceiveXString(netstm, null);
                    throw new Exception("Error from DFS protocol: " + errmsg);
                }
                else
                {
                    throw new Exception("DFS protocol did not return a success");
                }
            }
        }