Skip to content

Instantly share code, notes, and snippets.

@yxbh
Created May 10, 2015 08:32
Show Gist options
  • Save yxbh/4c8ff1bd1e33cc45b959 to your computer and use it in GitHub Desktop.
Save yxbh/4c8ff1bd1e33cc45b959 to your computer and use it in GitHub Desktop.
enum CollectorStatus { Idle, Working }
class Analyst
{
private:
int m_handle;
Status m_status;
}
class Collector
{
int m_handle
}
std::vector<Sockets> m_collectors
std::vector<Analyst>
Socket new_socket;
for (;;)
{
// accepting new analyst
new_socket = accept(/...//)
if (new_socket is valid)
{
m_collectors.push_back(new_socket);
}
// accepting collectors
new_socket = accept(/...//)
if (new_socket is valid)
{
m_collectors.push_back(new_socket);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment