History

GSF.ServiceProcess: Fixed issue where normal messages were flowing during a telnet sessions.

J. Ritchie Carroll committed 9 years ago

Commit fded2741 parent 2fc3cac12 files · +30 −102Browse files

Showing the changes to Source/Libraries/GSF.ServiceProcess (6 of 12 files). Show all

Unified · Split

6 files
  1. Source/Libraries/GSF.ServiceProcess/ClientHelper.cs +2 −8
  2. Source/Libraries/GSF.ServiceProcess/ClientInfo.cs +6 −36
  3. Source/Libraries/GSF.ServiceProcess/ClientRequest.cs +2 −8
  4. Source/Libraries/GSF.ServiceProcess/ServiceHelper.cs +4 −10
  5. Source/Libraries/GSF.ServiceProcess/ServiceProcess.cs +3 −21
  6. Source/Libraries/GSF.ServiceProcess/ServiceResponse.cs +1 −7
Source/Libraries/GSF.ServiceProcess/ClientHelper.cs+2−8
@@ -394,13 +394,7 @@ namespace GSF.ServiceProcess · 393 unmodified lines
394 [Browsable(false),394 [Browsable(false),
395 EditorBrowsable(EditorBrowsableState.Never),395 EditorBrowsable(EditorBrowsableState.Never),
396 DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]396 DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
397 public bool IsDisposed397 public bool IsDisposed => m_disposed;
398 {
399 get
400 {
401 return m_disposed;
402 }
403 }
404 398
405 #endregion399 #endregion
406 400
@@ -596,7 +590,7 @@ namespace GSF.ServiceProcess · 189 unmodified lines
596 else590 else
597 {591 {
598 // File does not exist.592 // File does not exist.
599 throw new FileNotFoundException(string.Format("File '{0}' does not exist", source));593 throw new FileNotFoundException($"File '{source}' does not exist");
600 }594 }
601 }595 }
602 596
Source/Libraries/GSF.ServiceProcess/ClientInfo.cs+6−36
@@ -107,7 +107,7 @@ namespace GSF.ServiceProcess · 106 unmodified lines
107 if ((object)parent == null || string.IsNullOrEmpty(parent.Username) || string.IsNullOrEmpty(parent.Password))107 if ((object)parent == null || string.IsNullOrEmpty(parent.Username) || string.IsNullOrEmpty(parent.Password))
108 m_clientUserCredentials = string.Empty;108 m_clientUserCredentials = string.Empty;
109 else109 else
110 m_clientUserCredentials = string.Format("{0}:{1}", parent.Username, parent.Password);110 m_clientUserCredentials = $"{parent.Username}:{parent.Password}";
111 111
112 // Initialize client application name.112 // Initialize client application name.
113 if (m_clientType == ApplicationType.Web)113 if (m_clientType == ApplicationType.Web)
@@ -181,57 +181,27 @@ namespace GSF.ServiceProcess · 67 unmodified lines
181 /// <summary>181 /// <summary>
182 /// Gets the <see cref="ApplicationType"/> of the remote client application.182 /// Gets the <see cref="ApplicationType"/> of the remote client application.
183 /// </summary>183 /// </summary>
184 public ApplicationType ClientType184 public ApplicationType ClientType => m_clientType;
185 {
186 get
187 {
188 return m_clientType;
189 }
190 }
191 185
192 /// <summary>186 /// <summary>
193 /// Gets the friendly name of the remote client application.187 /// Gets the friendly name of the remote client application.
194 /// </summary>188 /// </summary>
195 public string ClientName189 public string ClientName => m_clientName;
196 {
197 get
198 {
199 return m_clientName;
200 }
201 }
202 190
203 /// <summary>191 /// <summary>
204 /// Gets the <see cref="IPrincipal"/> of the remote client application's user.192 /// Gets the <see cref="IPrincipal"/> of the remote client application's user.
205 /// </summary>193 /// </summary>
206 public IPrincipal ClientUser194 public IPrincipal ClientUser => m_clientUser;
207 {
208 get
209 {
210 return m_clientUser;
211 }
212 }
213 195
214 /// <summary>196 /// <summary>
215 /// Gets the credentials in 'username:password' format for authenticating the remote client application's user if a valid <see cref="ClientUser"/> is not available.197 /// Gets the credentials in 'username:password' format for authenticating the remote client application's user if a valid <see cref="ClientUser"/> is not available.
216 /// </summary>198 /// </summary>
217 public string ClientUserCredentials199 public string ClientUserCredentials => m_clientUserCredentials;
218 {
219 get
220 {
221 return m_clientUserCredentials;
222 }
223 }
224 200
225 /// <summary>201 /// <summary>
226 /// Gets the name of the machine running the remote client application.202 /// Gets the name of the machine running the remote client application.
227 /// </summary>203 /// </summary>
228 public string MachineName204 public string MachineName => m_machineName;
229 {
230 get
231 {
232 return m_machineName;
233 }
234 }
235 205
236 /// <summary>206 /// <summary>
237 /// Gets or sets the <see cref="DateTime"/> when the remote client application connected to the <see cref="ServiceHelper"/>.207 /// Gets or sets the <see cref="DateTime"/> when the remote client application connected to the <see cref="ServiceHelper"/>.
Source/Libraries/GSF.ServiceProcess/ClientRequest.cs+2−8
@@ -153,13 +153,7 @@ namespace GSF.ServiceProcess · 152 unmodified lines
153 /// <summary>153 /// <summary>
154 /// Gets a list of attachments for the <see cref="ClientRequest"/>.154 /// Gets a list of attachments for the <see cref="ClientRequest"/>.
155 /// </summary>155 /// </summary>
156 public List<object> Attachments156 public List<object> Attachments => m_attachments;
157 {
158 get
159 {
160 return m_attachments;
161 }
162 }
163 157
164 #endregion158 #endregion
165 159
@@ -171,7 +165,7 @@ namespace GSF.ServiceProcess · 5 unmodified lines
171 /// <returns>A <see cref="String"/> that represents the <see cref="ClientRequest"/>.</returns>165 /// <returns>A <see cref="String"/> that represents the <see cref="ClientRequest"/>.</returns>
172 public override string ToString()166 public override string ToString()
173 {167 {
174 return string.Format("{0} {1}", m_command, m_arguments).Trim();168 return $"{m_command} {m_arguments}".Trim();
175 }169 }
176 170
177 /// <summary>171 /// <summary>
Source/Libraries/GSF.ServiceProcess/ServiceHelper.cs+4−10
@@ -2448,9 +2448,9 @@ namespace GSF.ServiceProcess · 2447 unmodified lines
2448 SendResponse(clientID, new ServiceResponse("AuthenticationFailure"));2448 SendResponse(clientID, new ServiceResponse("AuthenticationFailure"));
2449 }2449 }
2450 2450
2451 private void SendUpdateClientStatusResponse(Guid clientID, UpdateType type, string responseMessage)2451 private void SendUpdateClientStatusResponse(Guid clientID, UpdateType type, string responseMessage, bool telnetMessage = false)
2452 {2452 {
2453 if (string.IsNullOrEmpty(responseMessage))2453 if (string.IsNullOrEmpty(responseMessage) || (clientID == m_remoteCommandClientID && !telnetMessage))
2454 return;2454 return;
2455 2455
2456 ServiceResponse response = new ServiceResponse();2456 ServiceResponse response = new ServiceResponse();
@@ -2680,15 +2680,9 @@ namespace GSF.ServiceProcess · 223 unmodified lines
2680 }2680 }
2681 }2681 }
2682 2682
2683 private void RemoteCommandProcess_ErrorDataReceived(object sender, DataReceivedEventArgs e)2683 private void RemoteCommandProcess_ErrorDataReceived(object sender, DataReceivedEventArgs e) => SendUpdateClientStatusResponse(m_remoteCommandClientID, UpdateType.Alarm, $"{e.Data}\r\n", true);
2684 {
2685 UpdateStatus(m_remoteCommandClientID, UpdateType.Alarm, e.Data + "\r\n");
2686 }
2687 2684
2688 private void RemoteCommandProcess_OutputDataReceived(object sender, DataReceivedEventArgs e)2685 private void RemoteCommandProcess_OutputDataReceived(object sender, DataReceivedEventArgs e) => SendUpdateClientStatusResponse(m_remoteCommandClientID, UpdateType.Information, $"{e.Data}\r\n", true);
2689 {
2690 UpdateStatus(m_remoteCommandClientID, UpdateType.Information, e.Data + "\r\n");
2691 }
2692 2686
2693 #region [ Client Request Handlers ]2687 #region [ Client Request Handlers ]
2694 2688
Source/Libraries/GSF.ServiceProcess/ServiceProcess.cs+3−21
@@ -198,35 +198,17 @@ namespace GSF.ServiceProcess · 197 unmodified lines
198 /// <summary>198 /// <summary>
199 /// Gets the <see cref="DateTime"/> when execution of <see cref="ServiceProcess"/> last started.199 /// Gets the <see cref="DateTime"/> when execution of <see cref="ServiceProcess"/> last started.
200 /// </summary>200 /// </summary>
201 public DateTime ExecutionStartTime201 public DateTime ExecutionStartTime => m_executionStartTime;
202 {
203 get
204 {
205 return m_executionStartTime;
206 }
207 }
208 202
209 /// <summary>203 /// <summary>
210 /// Gets the <see cref="DateTime"/> when execution of <see cref="ServiceProcess"/> last completed.204 /// Gets the <see cref="DateTime"/> when execution of <see cref="ServiceProcess"/> last completed.
211 /// </summary>205 /// </summary>
212 public DateTime ExecutionStopTime206 public DateTime ExecutionStopTime => m_executionStopTime;
213 {
214 get
215 {
216 return m_executionStopTime;
217 }
218 }
219 207
220 /// <summary>208 /// <summary>
221 /// Gets the <see cref="Time"/> taken by the <see cref="ServiceProcess"/> during the last execution.209 /// Gets the <see cref="Time"/> taken by the <see cref="ServiceProcess"/> during the last execution.
222 /// </summary>210 /// </summary>
223 public Time LastExecutionTime211 public Time LastExecutionTime => Ticks.ToSeconds(m_executionStopTime.Ticks - m_executionStartTime.Ticks);
224 {
225 get
226 {
227 return Ticks.ToSeconds(m_executionStopTime.Ticks - m_executionStartTime.Ticks);
228 }
229 }
230 212
231 /// <summary>213 /// <summary>
232 /// Gets the descriptive status of the <see cref="ServiceProcess"/>.214 /// Gets the descriptive status of the <see cref="ServiceProcess"/>.
Source/Libraries/GSF.ServiceProcess/ServiceResponse.cs+1−7
@@ -146,13 +146,7 @@ namespace GSF.ServiceProcess · 145 unmodified lines
146 /// <summary>146 /// <summary>
147 /// Gets a list of serializable attachments of the <see cref="ServiceResponse"/>.147 /// Gets a list of serializable attachments of the <see cref="ServiceResponse"/>.
148 /// </summary>148 /// </summary>
149 public List<object> Attachments149 public List<object> Attachments => m_attachments;
150 {
151 get
152 {
153 return m_attachments;
154 }
155 }
156 150
157 #endregion151 #endregion
158 152

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t