TCP server with multiple Clients

前端 未结 1 1538
一生所求
一生所求 2020-12-03 06:23

I am working on TCP server/client application.

My question is:

My server application starts a new thread and blocks it until connection is accepted the list

相关标签:
1条回答
  • 2020-12-03 06:45

    Your client will be dispatched in different threads, so they will not intersect. You just need to add something like "DispatchMethod" where your messages will be processed.

    using System.Text.RegularExpressions;
    ...
    
    if (Regex.IsMatch(bufferincmessage, Properties.Settings.Default.REQLogin, RegexOptions.IgnoreCase))
    {
        ...
    }
    else if (Regex.IsMatch(bufferincmessage, /*some of your command1*/, RegexOptions.IgnoreCase))
    {
        ...
    }
    else if (Regex.IsMatch(bufferincmessage, /*some of your command1*/, RegexOptions.IgnoreCase))
    {
        ...
    }
    
    0 讨论(0)
提交回复
热议问题