Выбрать главу

Alternatively, if you don’t have root access, or just don’t want the daemon running, you can manually start the server with the Perl script server.pl. If you don’t specify a port, the server picks the first one available and prints out the port number. This is usually 4033. If no connection shows up in about two minutes, the server times out. A manually launched server also terminates when you terminate the connection.

The process is essentially the same for a Windows remote system, except that the scripts are called respectively daemon.bat and server.bat.

To establish a dstore connection, click the New Connection icon and select either Linux or Windows as the remote system type. Specify the host name and a connection name, just as we did for the SSH connection. Click Next. In this dialog (Figure 6.7) Launcher Properties specifies how the server is started on the remote system. If you started the daemon on the remote system, then select Daemon as the Launcher. If you manually started the server, select Running.

Click Finish. Right-click on the new entry in the Remote Systems view and click Connect.

Personally, I find the SSH Only connection to be simpler and easier to work with. Dstore is useful in connecting to Windows boxes, because standard Windows doesn’t include an SSH server.

Creating a Second Connection

There are times when you might want to have two or more connections open to the same remote system. You might want to log on with a different user ID, for example. Or you might want to have both a dstore and an SSH connection open.

With the first connection selected in the Remote Systems view, click the New Connection icon or right-click and select New→Connection. The Host name remains the same. You just need to give it a unique Connection name. Go ahead and create a second connection, because we’ll use it to illustrate referencing filter pools later on.

Figure 6.7: Setting launcher properties. 

6.2.2 Filters and Filter Pools

The entries My Home and Root under Sftp Files in your first remote connection are known as filters. RSE automatically creates these two filters for every SSH connection. Right-click on My Home and select Properties. The Filter Information page tells you that this is a Filter Resource and gives its name. It also says that it belongs to a specified filter pool and profile. The Filter Strings page tells you that this filter points to the home folder “.” and that displayed file entries are filtered by name, but the file name filter, in fact, is “*” or everything. Note that none of this information is editable in the default filters that RSE creates.

You can create your own filters to simplify the management of remote resources. You might, for example, want a filter that lists just C/C++ source files, those with a .c, .h, or .cpp extension. Pick a folder on your remote system that has some source files in it, or in subfolders. In my case, it’s drivers/ that has some examples for my Linux device driver class.

Right-click the folder name and select New→Filter…. This brings up the dialog in Figure 6.8. Select Subset by file types, and click Select…. This brings up a list of file extensions, but sadly, .c and .h aren’t listed. In Other Extensions enter “c,h,cpp” and click OK.

Figure 6.8: Creating a filter.

Click Next and give the filter a name, “My C Files,” for example. On this screen you also have a choice of making this filter private to this connection or making it part of a filter pool, which makes it visible to other connections. Uncheck the Only create filter in this connection box to make it part of the default filter pool. Clicking Next brings up some “tips” about filters and filter pools. Click Finish.

The new filter shows up below Root under Sftp Files in your remote connection. For filters you create, you can modify the Filter Strings from the Properties page and add new filter strings.

Over time, you may end up with such a large number of filters that the system becomes hard to navigate. The solution is to aggregate related filters into filter pools. But in order to work with filter pools, we have to make them visible. Select Window→Preferences→Remote Systems and check the Show filter pools in Remote Systems view box. While you’re there have a look at some of the other preferences related to remote systems. Click Apply and then OK.[6]

Back in the Remote Systems view, the filters previously listed under Sftp Files have been replaced by a filter pool entry called <profile_name>:ssh.files, where <profile_name> is the name of the default RSE profile that defaults to the name of your local host system. Expand the filter pool entry to reveal the same set of filters we previously had. Right-click the pool entry and select Properties. Here we see that this is not a filter pool but is, in fact, a reference to a filter pool.

Filter pools are associated with profiles and then referenced by connections. To create a new filter pool, right-click on Sftp Files and select New→Filter Pool… Give it a name, “My New Pool,” perhaps. At this point there should be only one profile to which it can be attached named for your host computer. Click Finish and the new pool shows up under Sftp Files. You can now create new filters to add to this pool.

You might want to make your new filter pool visible to the second connection we created earlier. Right-click on the Sftp Files entry of your second connection and select New→Filter Pool Reference→<your_host_name>→My New Pool. The new pool is now visible in your second connection.

6.2.3 Profiles

Profiles are the “big picture,” so to say, a way of tying everything together. RSE resources such as connections, filter pools, and other artifacts are owned by a profile. Figure 6.9 schematically illustrates how these elements tie together. Profiles are a useful tool for managing resources when you have a lot of connections.

Figure 6.9: The role of profiles.

RSE creates an initial profile when it’s started for the first time, usually named after the host name of the machine that creates the workspace. This profile is considered private and can’t be deleted or made inactive. All of the objects we’ve created so far have gone into this profile.

Profiles are managed from the Team view, which should currently look something like Figure 6.10. You should see three connections: your local host, and two connections to a remote target.

Figure 6.10: RSE Team view.

Creating a new profile is trivial. Click the New profile icon in the Team view menu. All you have to do is give it a name and decide whether or not to make it active. Click Finish and the new profile immediately shows up in the Team view. The new profile has Connections and Filter pool entries, but of course, they’re currently empty.

вернуться

6

You can also manipulate this preference by clicking the View Menu icon in the Remote Systems view.