LC.Communicator.ByFile 0.2.1

dotnet add package LC.Communicator.ByFile --version 0.2.1
NuGet\Install-Package LC.Communicator.ByFile -Version 0.2.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="LC.Communicator.ByFile" Version="0.2.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add LC.Communicator.ByFile --version 0.2.1
#r "nuget: LC.Communicator.ByFile, 0.2.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install LC.Communicator.ByFile as a Cake Addin
#addin nuget:?package=LC.Communicator.ByFile&version=0.2.1

// Install LC.Communicator.ByFile as a Cake Tool
#tool nuget:?package=LC.Communicator.ByFile&version=0.2.1

What is LC.Communicator.ByFile?

LC.Communicator.ByFile is a .NET Standard 2.0 (C#) implementation of the interface LC.Communicator.

It provides communication methodologies to allow communication between LabCognition software and a third party software during runtime of both applications by exchanging Json files through directories of the file system.

File exchange is achieved by serializing a Json command file into a directory monitored by the LabCognition software.

In case the counterpart is implemented and activated in the LabCognition software, it will respond by serializing a Json response file into another directory.

The response may be picked up and interpreted by the third party application.

Communication may also work the other way if implemented.

The implementation includes both, the server and the client side.

Client

The client side allows to send a message and wait for a response similar to http communication.

Available commands:

  • Get (sends the request and returns the response)
  • Put (no response)
  • Post (sends the request with content and returns the response)

CommunicationParameter

Communication parameters must be setup for the sender and the receiver side separately.

The monitored directory, communication timeout and file handling must be set appropriately before the client is used.

Request

The request's Command property value is used as Json file name for the command and also for the response.

The Parameter property is not used in this implementation.

Response

For Get and Post methods the returned data object is always embedded as result into a Response object, accordingly.

The MessageType property includes one of the Sender.Msgxxx strings indicating whether the command has been processed successfully or not.

In case of any error or warning, the corresponding details are provided in the Message property.

Receiver

The receiver listens to the monitored directory for incoming files. It picks up a new file and deserializes it according to the requested object type. The file might be deleted after interpretation according to the DeleteFileAfterInterpretation proeprty. The receiver can be used stand-alone (see Sender section below).

Sender

The Sender simply serializes a Json file into the target directory setup in the SenderParameter property.

Client Side implementation

Create an instance of the Client class, setup SenderParameter and ReceiverParameter and then call the Start() method to initialize it.

Now you can send requests using the Put, Post or Get methods.

To shutdown the client simply call the Stop method.

Server Side Implementation

Create an instance of the Receiver class and setup ReceiverParameter.

NOTE: The exchanged object type must be implemented on both, the client and the server side in the same way!

NOTE: When sending a list of parameters or objects, you may use the IContent interface for the transfer. LabCognition software will always send a IResponse<IContent[]> object

Call the Start() method to start monitoring.

Register the OnFileCreated event handler and implement the dispatcher for incoming messages.

To stop serving, call the Stop method.

Previous Versions

0.2.1

  • minor serialization bugfixes
  • documentation updates

0.2.0

Initial official published version.

Requirements

The following items are required to establish communication with LabCognition software:

  • A software implementing the server side
  • A software implementing the client side

Example Implementation

Please review the sample implementation to remote control the reaction monitoring module: RemoteControl.Panorama.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.2.1 452 1/19/2022