Class MachiningProjectGrpcServer
Server for exposing machining project functionality via gRPC.
public class MachiningProjectGrpcServer : IDisposable, IMakeXmlSource
- Inheritance
-
MachiningProjectGrpcServer
- Implements
- Inherited Members
- Extension Methods
Constructors
MachiningProjectGrpcServer(MachiningProject)
Initializes a new instance of the MachiningProjectGrpcServer class.
public MachiningProjectGrpcServer(MachiningProject millingCourse)
Parameters
millingCourse
MachiningProjectThe machining project to expose via gRPC
MachiningProjectGrpcServer(XElement, MachiningProject)
Initializes a new instance of the MachiningProjectGrpcServer class from XML.
public MachiningProjectGrpcServer(XElement src, MachiningProject millingCourse)
Parameters
src
XElementXML source element
millingCourse
MachiningProjectThe machining project to expose via gRPC
Properties
IsServiceRunning
Gets whether the service is currently running.
public bool IsServiceRunning { get; }
Property Value
ServicePort
Gets or sets the port used by the gRPC service.
public int ServicePort { get; set; }
Property Value
WebApplication
Gets the web application instance for the gRPC server.
public WebApplication WebApplication { get; }
Property Value
XName
Name for XML IO.
public static string XName { get; }
Property Value
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
Dispose(bool)
protected virtual void Dispose(bool disposing)
Parameters
disposing
bool
MakeXmlSource(string, string)
Creates an XML representation of the object. This method may also generate additional resources such as related files.
public XElement MakeXmlSource(string baseDirectory, string relFile)
Parameters
baseDirectory
stringThe base directory for resolving relative paths
relFile
stringThe relative file path for the XML source
Returns
- XElement
An XML element representing the object's state
Remarks
For the demand of easy moving source folder (especially project folder) without configuration file path corruption, the relative file path is applied.
The baseDirectory
is typically the folder at the nearest configuration file folder.
Since the folder can be moving with the configuration file.
StartAsync()
Starts the gRPC server asynchronously.
public Task StartAsync()
Returns
- Task
A task representing the asynchronous operation
StopAsync()
Stops the gRPC server asynchronously.
public Task StopAsync()
Returns
- Task
A task representing the asynchronous operation