Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions src/MTCAdapter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -519,16 +519,20 @@ private void ListenForClients()
{
while (mRunning)
{
//blocks until a client has connected to the server
TcpClient client = mListener.AcceptTcpClient();
//loop until there aren't pending clients
if (mListener.Pending())
{
//get the pending client
TcpClient client = mListener.AcceptTcpClient();

//create a thread to handle communication
//with connected client
Thread clientThread = new Thread(new ParameterizedThreadStart(HeartbeatClient));
clientThread.Start(client);
//create a thread to handle communication
//with connected client
Thread clientThread = new Thread(new ParameterizedThreadStart(HeartbeatClient));
clientThread.Start(client);

SendAllTo(client.GetStream());
clientThread.Join();
SendAllTo(client.GetStream());
clientThread.Join();
}
}
}
catch (Exception e)
Expand Down