Смекни!
smekni.com

7 Конфигурирование цифровых преобразователей 85 (стр. 13 из 35)

See “My Server”, page 55, for details of how to set up the server.

Additional clients may also request data from the Scream server. This method is known as “client pull”:

Все данные, полученные на последовательных портах сервера, будут посланы этим клиентам автоматически. На стороне клиента, чтобы начать получать данные, Вы должны просто установить флажок в окне Receive Data на вкладке My Client. Никакое другое действие не необходимо. Если Ваш клиент имеет межсетевую защиту, то Вы должны будете открыть порт UDP в стороне клиента.

Информацию как установить сервер Вы найдете в разделе 5.2, страница 60.

Дополнительные клиенты могут также запросить данные от сервера Scream. Этот метод известен как “client pull” - “клиент тянет

Рис. 5‑3 Метод “client pull”:

The requests are placed in UDP packets which the server can recognize. If your server is behind a firewall, you will need to unblock the UDP port at both client and server side.

To request data from the server by this method:

-Switch to the My Client tab.

-Check Receive Data to start Scream listening.

-Right-click anywhere in the Servers list box, and select Add UDP Server.... Enter the IP address in numerical form, followed by a colon:, and the port number on which the server is waiting for requests; e.g. 192.168.42.98:1567.

-Test communications by right-clicking on the newly-added server, and selecting GCFPING. A message appears in the Control pane logging the ping being sent. If communication is good, and the server is enabled for client requests, you will receive a GCFACKN message from the server which will also appear in the Control pane.

-Request data by right-clicking on the server and selecting GCFSEND:B (or GCFSEND:L) from the pop-up menu.(L is used for little-endian and B for big-endian byte order, and are distinguished for compatibility. If you are unsure, use B.) Streams should soon begin to appear in Scream's main window.

-To stop the link, right-click as before and select GCFSTOP from the pop-up menu. If you do not GCFSTOP, the server will continue to transmit to a client that is no longer listening. You should ensure that the server replies with a GCFACKN message If an acknowledgement does not appear in the Control pane, repeat the GCFSTOP command.

Scream automatically issues a GCFSTOP to all connected servers when it exits.

The steps above can be repeated as many times as necessary to pull data from several servers. Scream remembers all the network settings when it exits, and automatically tries to reconnect when you start it again.

Запросы помещены в пакеты UDP, которые сервер может опознать. Если Ваш сервер имеет межсетевую защиту (firewall), то Вы должны будете открыть порт UDP и на стороне клиента и на стороне сервера.

To request data from the server by this method:

Чтобы запросить данные от сервера этим методом:

1. Переключитесь на вкладку My Client.

2. Установите флажок в окне Receive Data,чтобы открыть список Scream.

3. Щелкните правой кнопкой мыши в области окна Servers, и выберите Add UDP Server...., Справа от colon: введите IP адрес в числовой форме и номер порта, на котором сервер ждет запросы; например 192.168.42.98:1567.

4. Проверьте связь, щелкнув правой кнопкой мыши на недавно добавленном сервере, и выбрав GCFPING. Если связь установлена, в области окна Control должно появиться сообщение, что ping отправлен.

Ping- Packet Internet Groper отправитель пакетов интернета - программа, используемая для проверки доступности адресата путем передачи ему специального сигнала - ICMP echo request - запрос отклика ICMP- и ожидания ответа).

Если связь будет нормальная, и сервер допущен для запросов клиента, то Вы получите сообщение GCFACKN от сервера, который также появится в области окна Control.

5. Чтобы запросить данные, щелкните правой кнопкой мыши на сервере и выберите из всплывающего меню GCFSEND:B (или GCFSEND:L). (L используется для little-endian и B для big-endian. Если Вы не уверены, используете B.). Потоки должны скоро начать появляться в главном окне Scream.

Little-endian - прямой порядок байтов (формат хранения и передачи двоичных данных, при котором сначала передается младший (наименее значимый) бит (байт).

Big-endian - обратный порядок байтов (формат для хранения и передачи двоичных данных, при которой старший (наиболее значимый) бит (или байт) передается сначала.

6. Чтобы остановить передачу, щелкните правой кнопкой мыши на сервере и выберите из всплывающего меню GCFSTOP. Если Вы не сделаете GCFSTOP, то сервер продолжит передавать данные клиенту, который больше не слушает. Вы должны убедиться, что сервер отвечает сообщением GCFACKN, Если подтверждение не появляется в области окна Control, повторите команду GCFSTOP.

Scream автоматически отправляет GCFSTOP все связанным серверам, когда завершает работу.

Шаги выше могут быть повторены как много раз по мере необходимости, чтобы получить данные от нескольких серверов. Scream помнит все сетевые параметры настройки, когда он выходит, и автоматически пытается повторно соединиться, когда Вы запускаете его снова.

5.1.1 TCP клиенты

TCP clients

Clients can also make a TCP connection to Scream and request data. Using this method, transmission of every block is guaranteed, but there is a significant overhead involved in keeping the connection active.

Clients using TCP can access the server by its host name as well as by its IP address. This is useful for installations whose IP address may change.

Клиенты могут также сделать TCP подключение к Scream и запросить данные. При использовании этого метода, гарантируется передача каждого пакета, платой за это является необходимость сохранения активного подключения.

TCP - Transmission Control Protocol - протокол управления передачей, протокол TCP широко используемый в Internet протокол транспортного уровня из набора TCP/IP. Гарантирует доставку передаваемых пакетов данных в нужной последовательности, но трафик при этом может быть весьма неравномерен, так как пакеты испытывают всевозможные задержки. Протокол TCP опирается на установление логического соединения между клиентом и сервером и включает в себя механизм контроля перегрузки сети, обеспечивая автоматическое снижение скорости обмена данными. Первая версия определена в RFC 793.

Клиенты, использующие TCP, могут обратиться к серверу как по именем компьютера, так и с его адресом IP. Это полезно для инсталляций, IP адрес которых может измениться.

5.1.2 Групповые клиенты

Multicast clients

Multicasting is a feature of TCP/IP which allows you to send network packets to several clients at once. These are most often used on local networks. Multicast servers use addresses between 224.0.0.0 and 239.255.255.255.

When you Add a multicast server, right-clicking on its entry in the Servers list box pops up a menu with Connect and Disconnect options in place of the GCFxxxx commands.

Selecting Connect instructs Scream to join the multicast group with that address. If the server is running, data should begin appearing immediately.

Selecting Disconnect makes Scream leave the multicast group. You can be in several multicast groups simultaneously, and join or leave each one independently of the others.

Мультивещание - особенность TCP/IP, позволяющая посылать сетевые пакеты нескольким клиентам сразу. Они чаще всего используются на местных сетях. Серверы мультиприведения используют адреса между 224.0.0.0 и 239.255.255.255.

Мультивещание (Multicasting) групповое вещание, групповая адресация передача пакетов данных из одной точки нескольким компьютерам (группе компьютеров) сети, в отличие от широковещательного режима, когда пересылка информации идёт всем узлам сразу.

Когда Вы Add -добавляете многоадресный (multicast) сервер, щелкая правой кнопкой мыши на его входе в окне Servers list, вместо команд GCFxxxx появляется меню с опциями Connect и Disconnect.

Выбор Connect инструктирует Scream присоединить “multicast” группу серверов с этим адресом. Если сервер работает, данные должны начать появляться немедленно.

Выбор Disconnect вызовет отключение группу серверов. Вы можете быть в нескольких группах “multicast” одновременно, и подключаться или отключаться от каждой независимо от других серверов.

5.2 Мой сервер

My Server

Scream's server transmits data over the network via UDP. To prevent network loops, only data from the local computer's serial ports is transmitted.

The list of clients that Scream is currently sending data is shown in the Clients table at the top of the My Server pane. Block-by-block details of the data being transmitted are shown in the Block Tx pane. Other server operations are reported in the Control pane to its right.

Scream's server transmits data over the network via UDP. To prevent network loops, only data from the local computer's serial ports is transmitted.

The list of clients that Scream is currently sending data is shown in the Clients table at the top of the My Server pane. Block-by-block details of the data being transmitted are shown in the Block Tx pane. Other server operations are reported in the Control pane to its right.

Сервер Scream's передает данные по сети через UDP. Чтобы предотвратить сетевые петли, передаются только данные от последовательных портов местного компьютера.

Список клиентов, которым Scream в настоящее время посылает данные, показывается в таблице Clients наверху области окна My Server. Детали пакета передаваемых данных показываются в области окна Block Tx. О других операциях сервера сообщают в области окна Control с правой стороны от него.

Рис. 5‑4

Both “server push” and “client pull” clients are listed in this pane. You can see which clients are using which method by looking in the Timeout column. When a pull clients requests data, its timeout is reset, and then starts counting down toward zero. If a pull client's timeout value reaches zero, Scream assumes it has stopped listening and removes it from the list. On the other hand, push clients do not have a timeout, because Scream will always try and transmit to them. Thus, clients using pull have a timeout figure listed in this column, whilst pull clients are shown with the entry None.

To start a server and listen for pull requests from clients, check the Transmit data from local Com Ports box on the My Server pane. No other action is necessary. If your server is behind a firewall, you will need to unblock the UDP port at the server side to receive these requests.

To push data to a particular client:

-Switch to the My Server pane.

-Check the Transmit data from local Com Ports box.

-Right-click anywhere in the Clients list box and select Add.... Enter the IP address and port number on which the server is waiting for requests, separated by a colon: (e.g. 192.168.42.98:1567)

You can add any number of clients, including broadcast addresses and multicast groups. If you want to broadcast or multicast UDP packets, you should obtain suitable addresses from your network administrator.

-To broadcast to all connected computers, use the IP address 255.255.255.255.

-To restrict broadcasts to a particular subnet, use the broadcast address for that subnet: for example 192.168.255.255:1567 will broadcast data on port 1567 to all clients whose IP addresses begin with 192.168.

-To send data to all Screams in a multicast group, use a multicast IP address. The range 239.255.0.0 – 239.255.255.255 is available for local networks, and 239.192.0.0 – 239.195.255.255 for organisation-level networks. Most other multicast addresses on the Internet must be specially registered.

The server will automatically start transmitting.

-To send data to another Scream running on the same computer, use the IP address 127.0.0.1.

To send data to more than one Scream running on the same computer, use the local broadcast address 127.0.0.255, or set up a multicast group.

You can limit the data Scream sends by setting a maximum sample rate for transmitted streams. Enter a value into the x sps transmitted block limit box to set this rate. This is useful if your network connection is slow or congested. The default value is 200 samples/s.

For example, if a digitizer is configured to generate 4 samples/s and 100 samples/s continuous data, you could monitor the data remotely over a low-bandwidth network by setting this value to 10. The high-rate data can still be recorded on the server if Scream is so configured (see Chapter 9, page 97) but it will not be sent over the network.