Skip to content

Instantly share code, notes, and snippets.

@salrashid123
Last active January 28, 2018 08:17
Show Gist options
  • Save salrashid123/ef811e28e18650ff1b0f128ed5405e8a to your computer and use it in GitHub Desktop.
Save salrashid123/ef811e28e18650ff1b0f128ed5405e8a to your computer and use it in GitHub Desktop.
Program.cs
.UseKestrel(options =>
{
try
{
for (int i = 0; i < args.Length; i++)
{
string value = args[i];
if (value == "--fds")
{
var fds = args[i+1].Split(",")[0];
string env_var = Environment.GetEnvironmentVariable("LD_LIBRARY_PATH");
logger.LogDebug("Using LD_LIBRARY_PATH: " + env_var);
logger.LogDebug("Setting kestrel ListenHandler to fd >>>>>>>> " + fds);
ulong fd = Convert.ToUInt64(fds);
options.ListenHandle(fd);
break;
}
}
}
catch (System.IndexOutOfRangeException e)
{
logger.LogError("Provided filedescriptor argument but unable to parse descriptor list " + e);
}
catch (Exception ex) {
logger.LogCritical(ex.Message);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment