OpenSCADAWiki: Home Page En/Doc/ Sockets ...

Home | Index | Changes | Comments | Users | Registration | Login  Password:  
 
This is an old revision of HomePageEn/Doc/Sockets from 2014-04-09 12:03:59..
Russian (1 Kb) Ðóññêàÿ âåðñèÿ?
Ukrainian (1 Kb) Óêðà¿íñüêà âåðñ³ÿ?

Module <Sockets> of subsystem "Transports"

Module:Sockets
Name:Sockets
Type:Transport
Source:tr_Sockets.so
Version:1.5.1
Author:Roman Savochenko
Translated:Maxim Lysenko
Description:Provides transport, based on the socket. It supports internet and unix sockets. Internet socket uses TCP and UDP protocols.
License:GPL

Contents

Introduction

Transport module Sockets provides support of transport based on the socket to the system. incoming and outgoing transport, based on internet sockets: TCP, UDP and UNIX sockets are supported. Addition of the new incoming and outgoing sockets can be done through the configuration of the transport subsystem in any system configurator of OpenSCADA.

1. Incoming transports

Configured and running incoming transport opens the server socket for the expectation of connection of the clients. In the case of the UNIX socket, the UNIX socket file is created. TCP and UNIX sockets are multi-stream, ie when the client connects to a socket of these type, the client socket and the new stream in which the client is served are created. Server socket in this moment switches to the waiting for the request from the new client. Thus the parallel service of the clients is achieved.


Each incoming socket is necessarily associated with one of the available transport protocols, to which incoming messages are transmitted. In conjunction with the transport protocol is supported by a mechanism of the combining of pieces of requests, disparate while transferring.


Configuration dialog of the incoming socket is depicted in Figure 1.


Configuration dialog of the incoming socket. (105 Kb)
Fig.1. Configuration dialog of the incoming socket.

Using this dialog you can set:

 (2 Kb) We do not recommend disable the function by the TCP/IP network's properties does not guarantee notice the server about the connection disable, for example after power supply lost on the client. As result the opened client connections will left forever and after its number achieve to the limit server will drop new connections!

Features of the formation of addresses of incoming sockets are shown in the table below:

Socket's typeAddress
TCP

TCP:{address}:{port}:{mode}
where:

  • address – Address, on which the socket is opened. It must be one of the addresses of the host. If nothing is specified, the socket will be available in all the host interfaces. There may be as symbolic as well as IP presentation of address.
  • port – Network port, on which the socket is opened. Indication of the character name of the port (according to /etc/services) is available.
  • mode – mode of working of the incoming socket (0 — close the connection after the session reception-response, 1 — do not close).

Example: "TCP::10001:1" — TCP-socket is available on all interfaces, is opened on port 10001 and doesn't close the connection.

UDP

UDP:{address}:{port}
where:

  • address – the same as in the TCP;
  • port – the same as in the TCP.

Example: "UDP:localhost:10001" — UDP-socket is only available on the "localhost" interface and is opened on the port 10001.

UNIX

UNIX:{name}:{mode}
where:

  • name – UNIX socket file name;
  • mode – the same as in the TCP.

Example: "UNIX:/tmp/oscada:1" — UNIX-socket is available through the file /tmp/oscada and it doesn't close the connection.

2. Outgoing transports

Configured and running outgoing transport opens a connection to the specified server. In the case of destroying of the connection, outgoing transport is disconnected. In order to resume the connection transport must be re-run.


Main tab of the configuration page of outgoing socket is shown in Fig.2.


Main tab of the configuration page of the outgoing socket. (81 Kb)
Fig.2. Main tab of the configuration page of the outgoing socket.

Using this dialog you can set:


The addresses of outgoing sockets of different types are formed as follows:

Socket's typeAddress
TCP/UDP

TCP:{address}:{port}
UDP:{address}:{port}
where:

  • address – Address to which the connection is performed. There may be as the symbolic representation as well as IP one of the address.
  • port – Network port, with which the connection is made. Indication of the character name of the port is available(according to /etc/services).

Example: "TCP:127.0.0.1:7634" — To connect to the port 7634 on the host 127.0.0.1.

UNIX

UNIX:{name}
where:

  • name – UNIX socket file name.

Example: "UNIX:/tmp/oscada" — to connect to the UNIX-socket through the file /tmp/oscada.

Links

Referring pages: HomePageEn/Doc
HomePageEn/Doc/BFN
HomePageEn/Doc/DAQ
HomePageEn/Doc/OPCUA
HomePageEn/Doc/QuickStart
HomePageEn/Doc/Serial
HomePageEn/Function
HomePageEn/Using/APIFunctionLibs/LibUserPrtDevs
HomePageEn/Using/PLC/firmware
HomePageEn/Using/SmartHouse

 
There are no files on this page.[Display files/form]
There is no comment on this page. [Display comments/form]