Skip to content

Commit

Permalink
ProtocolServer: Port to socket takeover
Browse files Browse the repository at this point in the history
  • Loading branch information
bugaevc authored and awesomekling committed Nov 26, 2019
1 parent bd55938 commit 9eaac26
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions Base/etc/SystemServer.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ StdIO=/dev/tty1
Priority=high

[ProtocolServer]
Socket=/tmp/portal/protocol
Priority=low
KeepAlive=1
User=anon
Expand Down
2 changes: 1 addition & 1 deletion Libraries/LibProtocol/Client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace LibProtocol {

Client::Client()
: ConnectionNG(*this, "/tmp/psportal")
: ConnectionNG(*this, "/tmp/portal/protocol")
{
handshake();
}
Expand Down
4 changes: 2 additions & 2 deletions Servers/ProtocolServer/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ int main(int, char**)
CEventLoop event_loop;
(void)*new HttpProtocol;
auto server = CLocalServer::construct();
unlink("/tmp/psportal");
server->listen("/tmp/psportal");
bool ok = server->take_over_from_system_server();
ASSERT(ok);
server->on_ready_to_accept = [&] {
auto client_socket = server->accept();
if (!client_socket) {
Expand Down

0 comments on commit 9eaac26

Please sign in to comment.