Example #1
0
        /*const int MODE_FMT = 0170000;
        const int MODE_DIR = 0040000;
        const int MODE_CHR = 0020000;
        const int MODE_BLK = 0060000;
        const int MODE_REG = 0100000;
        const int MODE_LNK = 0120000;
        const int MODE_SOCK = 0140000;
        const int MODE_FIFO = 0010000;*/

        #endregion

        #region Methods

        public void Connect(IPAddress Address, int UserID, int GroupID, int ClientTimeout, System.Text.Encoding characterEncoding, bool useSecurePort)
        {
            if (ClientTimeout == 0)
            { ClientTimeout = 60000; }

            if (characterEncoding == null)
            { characterEncoding = System.Text.Encoding.ASCII; }

            _RootDirectoryHandleObject = null;
            _CurrentItemHandleObject = null;

            _MountedDevice = String.Empty;
            _CurrentItem = String.Empty;

            _GroupID = GroupID;
            _UserID = UserID;

            _MountProtocolV2 = new NFSv2MountProtocolClient(Address, OncRpcProtocols.ONCRPC_UDP, useSecurePort);
            _ProtocolV2 = new NFSv2ProtocolClient(Address, OncRpcProtocols.ONCRPC_UDP, useSecurePort);

            OncRpcClientAuthUnix authUnix = new OncRpcClientAuthUnix(System.Environment.MachineName, UserID, GroupID);

            _MountProtocolV2.GetClient().setAuth(authUnix);
            _MountProtocolV2.GetClient().setTimeout(ClientTimeout);
            _MountProtocolV2.GetClient().setCharacterEncoding(characterEncoding.WebName);

            _ProtocolV2.GetClient().setAuth(authUnix);
            _ProtocolV2.GetClient().setTimeout(ClientTimeout);
            _ProtocolV2.GetClient().setCharacterEncoding(characterEncoding.WebName);
        }
Example #2
0
        public void Connect(IPAddress Address, int UserID, int GroupID, int ClientTimeout, System.Text.Encoding characterEncoding, bool useSecurePort,bool useCache)
        {
            if (ClientTimeout == 0)
            { ClientTimeout = 60000; }

            if (characterEncoding == null)
            { characterEncoding = System.Text.Encoding.ASCII; }

            _CurrentItem = String.Empty;

            useFHCache = useCache;
            

            if(useFHCache)
            cached_attrs = new Hashtable();//new Dictionary<string, NFSAttributes>();
            
            _rootFH = null;

            //_cwd = null;

            _cwf = null;

            //_cwhTree = new List<nfs_fh4>();
            //treePosition = 0;

            _GroupID = GroupID;
            _UserID = UserID;

            _ProtocolV4 = new NFSv4ProtocolClient(Address, OncRpcProtocols.ONCRPC_TCP, useSecurePort);

            OncRpcClientAuthUnix authUnix = new OncRpcClientAuthUnix(Address.ToString(), UserID, GroupID);

            _ProtocolV4.GetClient().setAuth(authUnix);
            _ProtocolV4.GetClient().setTimeout(ClientTimeout);
            _ProtocolV4.GetClient().setCharacterEncoding(characterEncoding.WebName);

            //send null dummy procedure to see if server is responding
            sendNullPRocedure();

        }