mirror of
https://github.com/badaix/snapcast.git
synced 2025-05-24 22:46:14 +02:00
server & client connection
git-svn-id: svn://elaine/murooma/trunk@270 d8a302eb-03bc-478d-80e4-98257eca68ef
This commit is contained in:
parent
d85858ac62
commit
2cf7855261
15 changed files with 184 additions and 123 deletions
|
@ -52,14 +52,16 @@ void ControlServer::acceptor()
|
|||
for (;;)
|
||||
{
|
||||
socket_ptr sock(new tcp::socket(io_service_));
|
||||
struct timeval tv;
|
||||
tv.tv_sec = 5;
|
||||
tv.tv_usec = 0;
|
||||
setsockopt(sock->native(), SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(tv));
|
||||
setsockopt(sock->native(), SOL_SOCKET, SO_SNDTIMEO, &tv, sizeof(tv));
|
||||
a.accept(*sock);
|
||||
cout << "ControlServer::NewConnection: " << sock->remote_endpoint().address().to_string() << "\n";
|
||||
ServerConnection* session = new ServerConnection(this, sock);
|
||||
sessions.insert(shared_ptr<ServerConnection>(session));
|
||||
session->start();
|
||||
// session->send(serverSettings);
|
||||
// session->send(sampleFormat);
|
||||
// session->send(headerChunk);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue