Closed logankp closed 7 years ago
@logankp Can you share the stack trace for the exception and the systemd unit file?
I will try to reproduce this. One question, I'm not sure why you are calling listen. I think systemd should call bind and listen; and you should call accept.
@tmds True, I meant accept(). I've updated the original comment.
Stack trace:
Unhandled Exception: System.InvalidOperationException: You must call the Bind method before performing this operation. at System.Net.Sockets.Socket.Accept() at SocketService.Program.Main(String[] args)
I'm using systemd-socket-activate for testing:
systemd-socket-activate -l 2000 dotnet /path/to/program.dll
@logankp can you try this using Version="0.2.0-*" from this myget feed:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="tmds" value="https://www.myget.org/F/tmds/api/v3/index.json" />
</packageSources>
</configuration>
@logankp there is a test that checks this case
It should work fine now. If you confirm it also works for you, we can close this issue.
Works great, thanks for all your hard work on this!
Great! No problem :) I'll push a new version to nuget.org tomorrow.
When a socket is passed in via systemd I should be able to just call accept() on it, however I get an InvalidOperationException that states "You must call the Bind method before performing this operation."