mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-24 21:46:52 +01:00
298 lines
49 KiB
HTML
298 lines
49 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
|
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
|
<meta name="generator" content="Doxygen 1.9.8"/>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
<title>tgstation-server: src/Tgstation.Server.Host.Service/ServiceLifetime.cs Source File</title>
|
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="jquery.js"></script>
|
|
<script type="text/javascript" src="dynsections.js"></script>
|
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
|
<script type="text/javascript" src="search/search.js"></script>
|
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
|
</head>
|
|
<body>
|
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
|
<div id="titlearea">
|
|
<table cellspacing="0" cellpadding="0">
|
|
<tbody>
|
|
<tr id="projectrow">
|
|
<td id="projectalign">
|
|
<div id="projectname">tgstation-server<span id="projectnumber"> 6.19.3</span>
|
|
</div>
|
|
<div id="projectbrief">The /tg/station 13 server suite</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<!-- end header part -->
|
|
<!-- Generated by Doxygen 1.9.8 -->
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
var searchBox = new SearchBox("searchBox", "search/",'.html');
|
|
/* @license-end */
|
|
</script>
|
|
<script type="text/javascript" src="menudata.js"></script>
|
|
<script type="text/javascript" src="menu.js"></script>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
$(function() {
|
|
initMenu('',true,false,'search.php','Search');
|
|
$(document).ready(function() { init_search(); });
|
|
});
|
|
/* @license-end */
|
|
</script>
|
|
<div id="main-nav"></div>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
$(document).ready(function() { init_codefold(0); });
|
|
/* @license-end */
|
|
</script>
|
|
<!-- window showing the filter options -->
|
|
<div id="MSearchSelectWindow"
|
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
|
</div>
|
|
|
|
<!-- iframe showing the search results (closed by default) -->
|
|
<div id="MSearchResultsWindow">
|
|
<div id="MSearchResults">
|
|
<div class="SRPage">
|
|
<div id="SRIndex">
|
|
<div id="SRResults"></div>
|
|
<div class="SRStatus" id="Loading">Loading...</div>
|
|
<div class="SRStatus" id="Searching">Searching...</div>
|
|
<div class="SRStatus" id="NoMatches">No Matches</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="nav-path" class="navpath">
|
|
<ul>
|
|
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_a01d946a2e1b048dc542232ffcdcf572.html">Tgstation.Server.Host.Service</a></li> </ul>
|
|
</div>
|
|
</div><!-- top -->
|
|
<div class="header">
|
|
<div class="headertitle"><div class="title">ServiceLifetime.cs</div></div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
<a href="_service_lifetime_8cs.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="keyword">using </span>System;</div>
|
|
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="keyword">using </span>System.IO;</div>
|
|
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="keyword">using </span>System.IO.Pipes;</div>
|
|
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="keyword">using </span>System.Linq;</div>
|
|
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="keyword">using </span>System.Text;</div>
|
|
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span><span class="keyword">using </span>System.Threading;</div>
|
|
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="keyword">using </span>System.Threading.Tasks;</div>
|
|
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span> </div>
|
|
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="keyword">using </span>Microsoft.Extensions.Logging;</div>
|
|
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span> </div>
|
|
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="keyword">using </span><a class="code hl_namespace" href="namespace_tgstation_1_1_server_1_1_host_1_1_common.html">Tgstation.Server.Host.Common</a>;</div>
|
|
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span><span class="keyword">using </span><a class="code hl_namespace" href="namespace_tgstation_1_1_server_1_1_host_1_1_watchdog.html">Tgstation.Server.Host.Watchdog</a>;</div>
|
|
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span> </div>
|
|
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span><span class="keyword">namespace </span><a class="code hl_namespace" href="namespace_tgstation_1_1_server_1_1_host_1_1_service.html">Tgstation.Server.Host.Service</a></div>
|
|
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span>{</div>
|
|
<div class="foldopen" id="foldopen00019" data-start="{" data-end="};">
|
|
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"><a class="line" href="class_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime.html"> 19</a></span> <span class="keyword">sealed</span> <span class="keyword">class </span><a class="code hl_class" href="class_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime.html">ServiceLifetime</a> : <a class="code hl_interface" href="interface_tgstation_1_1_server_1_1_host_1_1_watchdog_1_1_i_signal_checker.html">ISignalChecker</a>, <a class="code hl_class" href="class_i_async_disposable.html">IAsyncDisposable</a></div>
|
|
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> {</div>
|
|
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"><a class="line" href="class_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime.html#a59a604f1e6957c8c33502c30a1a436c7"> 24</a></span> readonly ILogger<ServiceLifetime> <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime.html#a59a604f1e6957c8c33502c30a1a436c7">logger</a>;</div>
|
|
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span> </div>
|
|
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"><a class="line" href="class_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime.html#adf6c8ff93fead448c9cfb931200badfc"> 29</a></span> readonly Task <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime.html#adf6c8ff93fead448c9cfb931200badfc">watchdogTask</a>;</div>
|
|
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> </div>
|
|
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"><a class="line" href="class_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime.html#a0b74bfd1c1bac13ab02659d3ebf235b3"> 34</a></span> readonly CancellationTokenSource <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime.html#a0b74bfd1c1bac13ab02659d3ebf235b3">cancellationTokenSource</a>;</div>
|
|
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> </div>
|
|
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"><a class="line" href="class_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime.html#ae0c3d236a6c39b9b2f0e22c47a8c11e3"> 39</a></span> AnonymousPipeServerStream? <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime.html#ae0c3d236a6c39b9b2f0e22c47a8c11e3">commandPipeServer</a>;</div>
|
|
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span> </div>
|
|
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"><a class="line" href="class_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime.html#a1ad4d503bcab123aa519d9f3845ed900"> 44</a></span> AnonymousPipeServerStream? <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime.html#a1ad4d503bcab123aa519d9f3845ed900">readyPipeServer</a>;</div>
|
|
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> </div>
|
|
<div class="foldopen" id="foldopen00053" data-start="{" data-end="}">
|
|
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"><a class="line" href="class_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime.html#a925943af5c4c8e2254ef174e007d1350"> 53</a></span> <span class="keyword">public</span> <a class="code hl_function" href="class_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime.html#a925943af5c4c8e2254ef174e007d1350">ServiceLifetime</a>(Action stopService, Func<ISignalChecker, IWatchdog> watchdogFactory, ILogger<ServiceLifetime> <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime.html#a59a604f1e6957c8c33502c30a1a436c7">logger</a>, <span class="keywordtype">string</span>[] args)</div>
|
|
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span> {</div>
|
|
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span> ArgumentNullException.ThrowIfNull(stopService);</div>
|
|
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span> ArgumentNullException.ThrowIfNull(watchdogFactory);</div>
|
|
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span> this.logger = <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime.html#a59a604f1e6957c8c33502c30a1a436c7">logger</a> ?? <span class="keywordflow">throw</span> <span class="keyword">new</span> ArgumentNullException(nameof(<a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime.html#a59a604f1e6957c8c33502c30a1a436c7">logger</a>));</div>
|
|
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span> ArgumentNullException.ThrowIfNull(args);</div>
|
|
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> </div>
|
|
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime.html#a59a604f1e6957c8c33502c30a1a436c7">logger</a>.LogDebug(<span class="stringliteral">"Starting service lifetime as user: {username}"</span>, Environment.UserName);</div>
|
|
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> </div>
|
|
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span> <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime.html#a0b74bfd1c1bac13ab02659d3ebf235b3">cancellationTokenSource</a> = <span class="keyword">new</span> CancellationTokenSource();</div>
|
|
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime.html#adf6c8ff93fead448c9cfb931200badfc">watchdogTask</a> = <a class="code hl_function" href="class_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime.html#aca6fdfa37c501c190e4698c758cd0b94">RunWatchdog</a>(</div>
|
|
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span> stopService,</div>
|
|
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> watchdogFactory(<span class="keyword">this</span>),</div>
|
|
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span> args,</div>
|
|
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime.html#a0b74bfd1c1bac13ab02659d3ebf235b3">cancellationTokenSource</a>.Token);</div>
|
|
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span> }</div>
|
|
</div>
|
|
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> </div>
|
|
<div class="foldopen" id="foldopen00071" data-start="{" data-end="}">
|
|
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"><a class="line" href="class_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime.html#a799bb246c7b70a09b645d487c90e1ddd"> 71</a></span> <span class="keyword">public</span> async ValueTask <a class="code hl_function" href="class_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime.html#a799bb246c7b70a09b645d487c90e1ddd">DisposeAsync</a>()</div>
|
|
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> {</div>
|
|
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span> <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime.html#a0b74bfd1c1bac13ab02659d3ebf235b3">cancellationTokenSource</a>.Cancel();</div>
|
|
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span> await <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime.html#adf6c8ff93fead448c9cfb931200badfc">watchdogTask</a>;</div>
|
|
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span> <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime.html#a0b74bfd1c1bac13ab02659d3ebf235b3">cancellationTokenSource</a>.Dispose();</div>
|
|
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span> </div>
|
|
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span> <span class="keywordflow">if</span> (<a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime.html#ae0c3d236a6c39b9b2f0e22c47a8c11e3">commandPipeServer</a> != <span class="keyword">null</span>)</div>
|
|
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> await <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime.html#ae0c3d236a6c39b9b2f0e22c47a8c11e3">commandPipeServer</a>.DisposeAsync();</div>
|
|
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> </div>
|
|
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> <span class="keywordflow">if</span> (<a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime.html#a1ad4d503bcab123aa519d9f3845ed900">readyPipeServer</a> != <span class="keyword">null</span>)</div>
|
|
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> await <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime.html#a1ad4d503bcab123aa519d9f3845ed900">readyPipeServer</a>.DisposeAsync();</div>
|
|
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> }</div>
|
|
</div>
|
|
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span> </div>
|
|
<div class="foldopen" id="foldopen00085" data-start="{" data-end="}">
|
|
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"><a class="line" href="class_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime.html#ac7136e1bf6be333978b64e559844aea4"> 85</a></span> <span class="keyword">public</span> async ValueTask <a class="code hl_function" href="class_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime.html#ac7136e1bf6be333978b64e559844aea4">CheckSignals</a>(Func<<span class="keywordtype">string</span>, (<span class="keywordtype">int</span>, Task)> startChildAndGetPid, CancellationToken cancellationToken)</div>
|
|
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> {</div>
|
|
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> <span class="keywordflow">try</span></div>
|
|
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> {</div>
|
|
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span> await <span class="keyword">using</span> (<a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime.html#ae0c3d236a6c39b9b2f0e22c47a8c11e3">commandPipeServer</a> = <span class="keyword">new</span> AnonymousPipeServerStream(PipeDirection.Out, HandleInheritability.Inheritable))</div>
|
|
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> await <span class="keyword">using</span> (<a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime.html#a1ad4d503bcab123aa519d9f3845ed900">readyPipeServer</a> = <span class="keyword">new</span> AnonymousPipeServerStream(PipeDirection.In, HandleInheritability.Inheritable))</div>
|
|
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> {</div>
|
|
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> var (_, lifetimeTask) = startChildAndGetPid($<span class="stringliteral">"--Internal:CommandPipe={commandPipeServer.GetClientHandleAsString()} --Internal:ReadyPipe={readyPipeServer.GetClientHandleAsString()}"</span>);</div>
|
|
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span> <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime.html#ae0c3d236a6c39b9b2f0e22c47a8c11e3">commandPipeServer</a>.DisposeLocalCopyOfClientHandle();</div>
|
|
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime.html#a1ad4d503bcab123aa519d9f3845ed900">readyPipeServer</a>.DisposeLocalCopyOfClientHandle();</div>
|
|
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> await lifetimeTask;</div>
|
|
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> }</div>
|
|
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span> }</div>
|
|
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span> <span class="keywordflow">finally</span></div>
|
|
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span> {</div>
|
|
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span> <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime.html#a1ad4d503bcab123aa519d9f3845ed900">readyPipeServer</a> = <span class="keyword">null</span>;</div>
|
|
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span> <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime.html#ae0c3d236a6c39b9b2f0e22c47a8c11e3">commandPipeServer</a> = <span class="keyword">null</span>;</div>
|
|
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> }</div>
|
|
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> }</div>
|
|
</div>
|
|
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> </div>
|
|
<div class="foldopen" id="foldopen00109" data-start="{" data-end="}">
|
|
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"><a class="line" href="class_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime.html#a1e2ad4a0782322f57acc5b988a771fb0"> 109</a></span> <span class="keyword">public</span> <span class="keywordtype">void</span> <a class="code hl_function" href="class_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime.html#a1e2ad4a0782322f57acc5b988a771fb0">HandleCustomCommand</a>(<span class="keywordtype">int</span> command)</div>
|
|
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span> {</div>
|
|
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span> var commandsToCheck = <a class="code hl_class" href="class_tgstation_1_1_server_1_1_host_1_1_common_1_1_pipe_commands.html">PipeCommands</a>.AllCommands;</div>
|
|
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span> <span class="keywordflow">foreach</span> (var stringCommand <span class="keywordflow">in</span> commandsToCheck)</div>
|
|
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span> {</div>
|
|
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span> var commandId = <a class="code hl_class" href="class_tgstation_1_1_server_1_1_host_1_1_common_1_1_pipe_commands.html">PipeCommands</a>.<a class="code hl_function" href="class_tgstation_1_1_server_1_1_host_1_1_common_1_1_pipe_commands.html#a06c8d3400eeb8207d35f8f3bae86cfb5">GetServiceCommandId</a>(stringCommand);</div>
|
|
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span> <span class="keywordflow">if</span> (command == commandId)</div>
|
|
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span> {</div>
|
|
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span> <a class="code hl_function" href="class_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime.html#aa48370d02550aa2beb55941b4226a423">SendCommandToHostThroughPipe</a>(stringCommand);</div>
|
|
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span> <span class="keywordflow">return</span>;</div>
|
|
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span> }</div>
|
|
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"> 120</span> }</div>
|
|
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span> </div>
|
|
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span> <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime.html#a59a604f1e6957c8c33502c30a1a436c7">logger</a>.LogWarning(<span class="stringliteral">"Received unknown service command: {command}"</span>, command);</div>
|
|
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span> }</div>
|
|
</div>
|
|
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span> </div>
|
|
<div class="foldopen" id="foldopen00133" data-start="{" data-end="}">
|
|
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"><a class="line" href="class_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime.html#aca6fdfa37c501c190e4698c758cd0b94"> 133</a></span> async Task <a class="code hl_function" href="class_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime.html#aca6fdfa37c501c190e4698c758cd0b94">RunWatchdog</a>(Action stopService, <a class="code hl_interface" href="interface_tgstation_1_1_server_1_1_host_1_1_watchdog_1_1_i_watchdog.html">IWatchdog</a> watchdog, <span class="keywordtype">string</span>[] args, CancellationToken cancellationToken)</div>
|
|
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"> 134</span> {</div>
|
|
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"> 135</span> var localWatchdogTask = watchdog.<a class="code hl_function" href="interface_tgstation_1_1_server_1_1_host_1_1_watchdog_1_1_i_watchdog.html#aba34e712e0cdbbd747feba6fb9f83176">RunAsync</a>(<span class="keyword">false</span>, args, cancellationToken);</div>
|
|
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"> 136</span> </div>
|
|
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span> <span class="keywordflow">if</span> (!localWatchdogTask.IsCompleted && (await watchdog.<a class="code hl_property" href="interface_tgstation_1_1_server_1_1_host_1_1_watchdog_1_1_i_watchdog.html#af99ee4a5ff309fe30b7e5c3c68ca458b">InitialHostVersion</a>) >= <span class="keyword">new</span> Version(5, 14, 0))</div>
|
|
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span> <span class="keywordflow">if</span> (<a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime.html#a1ad4d503bcab123aa519d9f3845ed900">readyPipeServer</a> != <span class="keyword">null</span>)</div>
|
|
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"> 139</span> {</div>
|
|
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno"> 140</span> <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime.html#a59a604f1e6957c8c33502c30a1a436c7">logger</a>.LogInformation(<span class="stringliteral">"Waiting for host to finish starting..."</span>);</div>
|
|
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno"> 141</span> <span class="keyword">using </span>var streamReader = <span class="keyword">new</span> StreamReader(</div>
|
|
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno"> 142</span> <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime.html#a1ad4d503bcab123aa519d9f3845ed900">readyPipeServer</a>,</div>
|
|
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"> 143</span> Encoding.UTF8,</div>
|
|
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"> 144</span> leaveOpen: <span class="keyword">true</span>);</div>
|
|
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"> 145</span> </div>
|
|
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"> 146</span> var line = streamReader.ReadLine(); <span class="comment">// Intentionally blocking service startup</span></div>
|
|
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno"> 147</span> <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime.html#a59a604f1e6957c8c33502c30a1a436c7">logger</a>.LogDebug(<span class="stringliteral">"Pipe read: {line}"</span>, line);</div>
|
|
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"> 148</span> </div>
|
|
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"> 149</span> <span class="comment">// Maybe we'll use this pipe more in the future, but for now leaving it open is just a resource waste</span></div>
|
|
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno"> 150</span> <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime.html#a1ad4d503bcab123aa519d9f3845ed900">readyPipeServer</a>.Dispose();</div>
|
|
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno"> 151</span> }</div>
|
|
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno"> 152</span> <span class="keywordflow">else</span></div>
|
|
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno"> 153</span> <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime.html#a59a604f1e6957c8c33502c30a1a436c7">logger</a>.LogError(<span class="stringliteral">"Watchdog started and ready pipe was not initialized!"</span>);</div>
|
|
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno"> 154</span> </div>
|
|
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno"> 155</span> await localWatchdogTask;</div>
|
|
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno"> 156</span> </div>
|
|
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno"> 157</span> async <span class="keywordtype">void</span> StopServiceAsync()</div>
|
|
<div class="line"><a id="l00158" name="l00158"></a><span class="lineno"> 158</span> {</div>
|
|
<div class="line"><a id="l00159" name="l00159"></a><span class="lineno"> 159</span> <span class="keywordflow">try</span></div>
|
|
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno"> 160</span> {</div>
|
|
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno"> 161</span> <span class="comment">// This can call OnStop which waits on this task to complete, must be threaded off or it will deadlock</span></div>
|
|
<div class="line"><a id="l00162" name="l00162"></a><span class="lineno"> 162</span> await Task.Run(stopService, cancellationToken);</div>
|
|
<div class="line"><a id="l00163" name="l00163"></a><span class="lineno"> 163</span> }</div>
|
|
<div class="line"><a id="l00164" name="l00164"></a><span class="lineno"> 164</span> <span class="keywordflow">catch</span> (OperationCanceledException ex)</div>
|
|
<div class="line"><a id="l00165" name="l00165"></a><span class="lineno"> 165</span> {</div>
|
|
<div class="line"><a id="l00166" name="l00166"></a><span class="lineno"> 166</span> <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime.html#a59a604f1e6957c8c33502c30a1a436c7">logger</a>.LogDebug(ex, <span class="stringliteral">"Stopping service cancelled!"</span>);</div>
|
|
<div class="line"><a id="l00167" name="l00167"></a><span class="lineno"> 167</span> }</div>
|
|
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno"> 168</span> <span class="keywordflow">catch</span> (<a class="code hl_class" href="class_exception.html">Exception</a> ex)</div>
|
|
<div class="line"><a id="l00169" name="l00169"></a><span class="lineno"> 169</span> {</div>
|
|
<div class="line"><a id="l00170" name="l00170"></a><span class="lineno"> 170</span> <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime.html#a59a604f1e6957c8c33502c30a1a436c7">logger</a>.LogError(ex, <span class="stringliteral">"Error stopping service!"</span>);</div>
|
|
<div class="line"><a id="l00171" name="l00171"></a><span class="lineno"> 171</span> }</div>
|
|
<div class="line"><a id="l00172" name="l00172"></a><span class="lineno"> 172</span> }</div>
|
|
<div class="line"><a id="l00173" name="l00173"></a><span class="lineno"> 173</span> </div>
|
|
<div class="line"><a id="l00174" name="l00174"></a><span class="lineno"> 174</span> StopServiceAsync();</div>
|
|
<div class="line"><a id="l00175" name="l00175"></a><span class="lineno"> 175</span> }</div>
|
|
</div>
|
|
<div class="line"><a id="l00176" name="l00176"></a><span class="lineno"> 176</span> </div>
|
|
<div class="foldopen" id="foldopen00181" data-start="{" data-end="}">
|
|
<div class="line"><a id="l00181" name="l00181"></a><span class="lineno"><a class="line" href="class_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime.html#aa48370d02550aa2beb55941b4226a423"> 181</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="class_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime.html#aa48370d02550aa2beb55941b4226a423">SendCommandToHostThroughPipe</a>(<span class="keywordtype">string</span> command)</div>
|
|
<div class="line"><a id="l00182" name="l00182"></a><span class="lineno"> 182</span> {</div>
|
|
<div class="line"><a id="l00183" name="l00183"></a><span class="lineno"> 183</span> var localPipeServer = <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime.html#ae0c3d236a6c39b9b2f0e22c47a8c11e3">commandPipeServer</a>;</div>
|
|
<div class="line"><a id="l00184" name="l00184"></a><span class="lineno"> 184</span> <span class="keywordflow">if</span> (localPipeServer == <span class="keyword">null</span>)</div>
|
|
<div class="line"><a id="l00185" name="l00185"></a><span class="lineno"> 185</span> {</div>
|
|
<div class="line"><a id="l00186" name="l00186"></a><span class="lineno"> 186</span> <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime.html#a59a604f1e6957c8c33502c30a1a436c7">logger</a>.LogWarning(<span class="stringliteral">"Unable to send command \"{command}\" to main server process. Is the service running?"</span>, command);</div>
|
|
<div class="line"><a id="l00187" name="l00187"></a><span class="lineno"> 187</span> <span class="keywordflow">return</span>;</div>
|
|
<div class="line"><a id="l00188" name="l00188"></a><span class="lineno"> 188</span> }</div>
|
|
<div class="line"><a id="l00189" name="l00189"></a><span class="lineno"> 189</span> </div>
|
|
<div class="line"><a id="l00190" name="l00190"></a><span class="lineno"> 190</span> <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime.html#a59a604f1e6957c8c33502c30a1a436c7">logger</a>.LogDebug(<span class="stringliteral">"Send command: {command}"</span>, command);</div>
|
|
<div class="line"><a id="l00191" name="l00191"></a><span class="lineno"> 191</span> <span class="keywordflow">try</span></div>
|
|
<div class="line"><a id="l00192" name="l00192"></a><span class="lineno"> 192</span> {</div>
|
|
<div class="line"><a id="l00193" name="l00193"></a><span class="lineno"> 193</span> var encoding = Encoding.UTF8;</div>
|
|
<div class="line"><a id="l00194" name="l00194"></a><span class="lineno"> 194</span> <span class="keyword">using </span>var streamWriter = <span class="keyword">new</span> StreamWriter(</div>
|
|
<div class="line"><a id="l00195" name="l00195"></a><span class="lineno"> 195</span> localPipeServer,</div>
|
|
<div class="line"><a id="l00196" name="l00196"></a><span class="lineno"> 196</span> encoding,</div>
|
|
<div class="line"><a id="l00197" name="l00197"></a><span class="lineno"> 197</span> <a class="code hl_class" href="class_tgstation_1_1_server_1_1_host_1_1_common_1_1_pipe_commands.html">PipeCommands</a></div>
|
|
<div class="line"><a id="l00198" name="l00198"></a><span class="lineno"> 198</span> .AllCommands</div>
|
|
<div class="line"><a id="l00199" name="l00199"></a><span class="lineno"> 199</span> .Select(</div>
|
|
<div class="line"><a id="l00200" name="l00200"></a><span class="lineno"> 200</span> command => encoding.GetByteCount(</div>
|
|
<div class="line"><a id="l00201" name="l00201"></a><span class="lineno"> 201</span> command + Environment.NewLine))</div>
|
|
<div class="line"><a id="l00202" name="l00202"></a><span class="lineno"> 202</span> .Max(),</div>
|
|
<div class="line"><a id="l00203" name="l00203"></a><span class="lineno"> 203</span> <span class="keyword">true</span>);</div>
|
|
<div class="line"><a id="l00204" name="l00204"></a><span class="lineno"> 204</span> streamWriter.WriteLine(command);</div>
|
|
<div class="line"><a id="l00205" name="l00205"></a><span class="lineno"> 205</span> }</div>
|
|
<div class="line"><a id="l00206" name="l00206"></a><span class="lineno"> 206</span> <span class="keywordflow">catch</span> (<a class="code hl_class" href="class_exception.html">Exception</a> ex)</div>
|
|
<div class="line"><a id="l00207" name="l00207"></a><span class="lineno"> 207</span> {</div>
|
|
<div class="line"><a id="l00208" name="l00208"></a><span class="lineno"> 208</span> <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime.html#a59a604f1e6957c8c33502c30a1a436c7">logger</a>.LogError(ex, <span class="stringliteral">"Error attempting to send command \"{command}\""</span>, command);</div>
|
|
<div class="line"><a id="l00209" name="l00209"></a><span class="lineno"> 209</span> }</div>
|
|
<div class="line"><a id="l00210" name="l00210"></a><span class="lineno"> 210</span> }</div>
|
|
</div>
|
|
<div class="line"><a id="l00211" name="l00211"></a><span class="lineno"> 211</span> }</div>
|
|
</div>
|
|
<div class="line"><a id="l00212" name="l00212"></a><span class="lineno"> 212</span>}</div>
|
|
<div class="ttc" id="aclass_exception_html"><div class="ttname"><a href="class_exception.html">Exception</a></div></div>
|
|
<div class="ttc" id="aclass_i_async_disposable_html"><div class="ttname"><a href="class_i_async_disposable.html">IAsyncDisposable</a></div></div>
|
|
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_common_1_1_pipe_commands_html"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_common_1_1_pipe_commands.html">Tgstation.Server.Host.Common.PipeCommands</a></div><div class="ttdoc">Values able to be passed via the update file path.</div><div class="ttdef"><b>Definition</b> <a href="_pipe_commands_8cs_source.html#l00006">PipeCommands.cs:7</a></div></div>
|
|
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_common_1_1_pipe_commands_html_a06c8d3400eeb8207d35f8f3bae86cfb5"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_common_1_1_pipe_commands.html#a06c8d3400eeb8207d35f8f3bae86cfb5">Tgstation.Server.Host.Common.PipeCommands.GetServiceCommandId</a></div><div class="ttdeci">static ? int GetServiceCommandId(string command)</div><div class="ttdoc">Gets the int value of a given command .</div></div>
|
|
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime_html"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime.html">Tgstation.Server.Host.Service.ServiceLifetime</a></div><div class="ttdoc">Represents the lifetime of the service.</div><div class="ttdef"><b>Definition</b> <a href="_service_lifetime_8cs_source.html#l00019">ServiceLifetime.cs:20</a></div></div>
|
|
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime_html_a0b74bfd1c1bac13ab02659d3ebf235b3"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime.html#a0b74bfd1c1bac13ab02659d3ebf235b3">Tgstation.Server.Host.Service.ServiceLifetime.cancellationTokenSource</a></div><div class="ttdeci">readonly CancellationTokenSource cancellationTokenSource</div><div class="ttdoc">The cancellationTokenSource for the ServerService.</div><div class="ttdef"><b>Definition</b> <a href="_service_lifetime_8cs_source.html#l00034">ServiceLifetime.cs:34</a></div></div>
|
|
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime_html_a1ad4d503bcab123aa519d9f3845ed900"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime.html#a1ad4d503bcab123aa519d9f3845ed900">Tgstation.Server.Host.Service.ServiceLifetime.readyPipeServer</a></div><div class="ttdeci">AnonymousPipeServerStream? readyPipeServer</div><div class="ttdoc">The AnonymousPipeServerStream for receiving the PipeCommands.CommandStartupComplete.</div><div class="ttdef"><b>Definition</b> <a href="_service_lifetime_8cs_source.html#l00044">ServiceLifetime.cs:44</a></div></div>
|
|
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime_html_a1e2ad4a0782322f57acc5b988a771fb0"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime.html#a1e2ad4a0782322f57acc5b988a771fb0">Tgstation.Server.Host.Service.ServiceLifetime.HandleCustomCommand</a></div><div class="ttdeci">void HandleCustomCommand(int command)</div><div class="ttdoc">Handle a custom service command .</div><div class="ttdef"><b>Definition</b> <a href="_service_lifetime_8cs_source.html#l00109">ServiceLifetime.cs:109</a></div></div>
|
|
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime_html_a59a604f1e6957c8c33502c30a1a436c7"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime.html#a59a604f1e6957c8c33502c30a1a436c7">Tgstation.Server.Host.Service.ServiceLifetime.logger</a></div><div class="ttdeci">readonly ILogger< ServiceLifetime > logger</div><div class="ttdoc">The ILogger for the ServerService.</div><div class="ttdef"><b>Definition</b> <a href="_service_lifetime_8cs_source.html#l00024">ServiceLifetime.cs:24</a></div></div>
|
|
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime_html_a799bb246c7b70a09b645d487c90e1ddd"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime.html#a799bb246c7b70a09b645d487c90e1ddd">Tgstation.Server.Host.Service.ServiceLifetime.DisposeAsync</a></div><div class="ttdeci">async ValueTask DisposeAsync()</div><div class="ttdef"><b>Definition</b> <a href="_service_lifetime_8cs_source.html#l00071">ServiceLifetime.cs:71</a></div></div>
|
|
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime_html_a925943af5c4c8e2254ef174e007d1350"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime.html#a925943af5c4c8e2254ef174e007d1350">Tgstation.Server.Host.Service.ServiceLifetime.ServiceLifetime</a></div><div class="ttdeci">ServiceLifetime(Action stopService, Func< ISignalChecker, IWatchdog > watchdogFactory, ILogger< ServiceLifetime > logger, string[] args)</div><div class="ttdoc">Initializes a new instance of the ServiceLifetime class.</div><div class="ttdef"><b>Definition</b> <a href="_service_lifetime_8cs_source.html#l00053">ServiceLifetime.cs:53</a></div></div>
|
|
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime_html_aa48370d02550aa2beb55941b4226a423"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime.html#aa48370d02550aa2beb55941b4226a423">Tgstation.Server.Host.Service.ServiceLifetime.SendCommandToHostThroughPipe</a></div><div class="ttdeci">void SendCommandToHostThroughPipe(string command)</div><div class="ttdoc">Sends a command to the main server process.</div><div class="ttdef"><b>Definition</b> <a href="_service_lifetime_8cs_source.html#l00181">ServiceLifetime.cs:181</a></div></div>
|
|
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime_html_ac7136e1bf6be333978b64e559844aea4"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime.html#ac7136e1bf6be333978b64e559844aea4">Tgstation.Server.Host.Service.ServiceLifetime.CheckSignals</a></div><div class="ttdeci">async ValueTask CheckSignals(Func< string,(int, Task)> startChildAndGetPid, CancellationToken cancellationToken)</div><div class="ttdef"><b>Definition</b> <a href="_service_lifetime_8cs_source.html#l00085">ServiceLifetime.cs:85</a></div></div>
|
|
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime_html_aca6fdfa37c501c190e4698c758cd0b94"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime.html#aca6fdfa37c501c190e4698c758cd0b94">Tgstation.Server.Host.Service.ServiceLifetime.RunWatchdog</a></div><div class="ttdeci">async Task RunWatchdog(Action stopService, IWatchdog watchdog, string[] args, CancellationToken cancellationToken)</div><div class="ttdoc">Executes the watchdog , stopping the service if it exits.</div><div class="ttdef"><b>Definition</b> <a href="_service_lifetime_8cs_source.html#l00133">ServiceLifetime.cs:133</a></div></div>
|
|
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime_html_adf6c8ff93fead448c9cfb931200badfc"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime.html#adf6c8ff93fead448c9cfb931200badfc">Tgstation.Server.Host.Service.ServiceLifetime.watchdogTask</a></div><div class="ttdeci">readonly Task watchdogTask</div><div class="ttdoc">The Task that represents the running ServerService.</div><div class="ttdef"><b>Definition</b> <a href="_service_lifetime_8cs_source.html#l00029">ServiceLifetime.cs:29</a></div></div>
|
|
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime_html_ae0c3d236a6c39b9b2f0e22c47a8c11e3"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_service_1_1_service_lifetime.html#ae0c3d236a6c39b9b2f0e22c47a8c11e3">Tgstation.Server.Host.Service.ServiceLifetime.commandPipeServer</a></div><div class="ttdeci">AnonymousPipeServerStream? commandPipeServer</div><div class="ttdoc">The AnonymousPipeServerStream for sending PipeCommands to the server process.</div><div class="ttdef"><b>Definition</b> <a href="_service_lifetime_8cs_source.html#l00039">ServiceLifetime.cs:39</a></div></div>
|
|
<div class="ttc" id="ainterface_tgstation_1_1_server_1_1_host_1_1_watchdog_1_1_i_signal_checker_html"><div class="ttname"><a href="interface_tgstation_1_1_server_1_1_host_1_1_watchdog_1_1_i_signal_checker.html">Tgstation.Server.Host.Watchdog.ISignalChecker</a></div><div class="ttdoc">For relaying signals received to the host process.</div><div class="ttdef"><b>Definition</b> <a href="_i_signal_checker_8cs_source.html#l00010">ISignalChecker.cs:11</a></div></div>
|
|
<div class="ttc" id="ainterface_tgstation_1_1_server_1_1_host_1_1_watchdog_1_1_i_watchdog_html"><div class="ttname"><a href="interface_tgstation_1_1_server_1_1_host_1_1_watchdog_1_1_i_watchdog.html">Tgstation.Server.Host.Watchdog.IWatchdog</a></div><div class="ttdoc">The watchdog for a Host.</div><div class="ttdef"><b>Definition</b> <a href="_tgstation_8_server_8_host_8_watchdog_2_i_watchdog_8cs_source.html#l00010">IWatchdog.cs:11</a></div></div>
|
|
<div class="ttc" id="ainterface_tgstation_1_1_server_1_1_host_1_1_watchdog_1_1_i_watchdog_html_aba34e712e0cdbbd747feba6fb9f83176"><div class="ttname"><a href="interface_tgstation_1_1_server_1_1_host_1_1_watchdog_1_1_i_watchdog.html#aba34e712e0cdbbd747feba6fb9f83176">Tgstation.Server.Host.Watchdog.IWatchdog.RunAsync</a></div><div class="ttdeci">ValueTask< bool > RunAsync(bool runConfigure, string[] args, CancellationToken cancellationToken)</div><div class="ttdoc">Run the IWatchdog.</div></div>
|
|
<div class="ttc" id="ainterface_tgstation_1_1_server_1_1_host_1_1_watchdog_1_1_i_watchdog_html_af99ee4a5ff309fe30b7e5c3c68ca458b"><div class="ttname"><a href="interface_tgstation_1_1_server_1_1_host_1_1_watchdog_1_1_i_watchdog.html#af99ee4a5ff309fe30b7e5c3c68ca458b">Tgstation.Server.Host.Watchdog.IWatchdog.InitialHostVersion</a></div><div class="ttdeci">Task< Version > InitialHostVersion</div><div class="ttdoc">Gets a Task<TResult> resulting in the current version of the host process. Guaranteed to complete onc...</div><div class="ttdef"><b>Definition</b> <a href="_tgstation_8_server_8_host_8_watchdog_2_i_watchdog_8cs_source.html#l00015">IWatchdog.cs:15</a></div></div>
|
|
<div class="ttc" id="anamespace_tgstation_1_1_server_1_1_host_1_1_common_html"><div class="ttname"><a href="namespace_tgstation_1_1_server_1_1_host_1_1_common.html">Tgstation.Server.Host.Common</a></div><div class="ttdef"><b>Definition</b> <a href="_tgstation_8_server_8_host_8_common_2_dotnet_helper_8cs_source.html#l00008">DotnetHelper.cs:9</a></div></div>
|
|
<div class="ttc" id="anamespace_tgstation_1_1_server_1_1_host_1_1_service_html"><div class="ttname"><a href="namespace_tgstation_1_1_server_1_1_host_1_1_service.html">Tgstation.Server.Host.Service</a></div><div class="ttdef"><b>Definition</b> <a href="_installation_extensions_8cs_source.html#l00001">InstallationExtensions.cs:2</a></div></div>
|
|
<div class="ttc" id="anamespace_tgstation_1_1_server_1_1_host_1_1_watchdog_html"><div class="ttname"><a href="namespace_tgstation_1_1_server_1_1_host_1_1_watchdog.html">Tgstation.Server.Host.Watchdog</a></div><div class="ttdef"><b>Definition</b> <a href="_bootstrap_settings_8cs_source.html#l00006">BootstrapSettings.cs:7</a></div></div>
|
|
</div><!-- fragment --></div><!-- contents -->
|
|
<!-- start footer part -->
|
|
<hr class="footer"/><address class="footer"><small>
|
|
Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.8
|
|
</small></address>
|
|
</body>
|
|
</html>
|