server & client connection

git-svn-id: svn://elaine/murooma/trunk@270 d8a302eb-03bc-478d-80e4-98257eca68ef
This commit is contained in:
(no author) 2014-09-17 04:57:59 +00:00
parent d85858ac62
commit 2cf7855261
15 changed files with 184 additions and 123 deletions

View file

@ -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);
}
}