最近由于业务的需要,Linux系统嵌入式设备往我做的服务程序发送数据。
速度奇慢,而且还是程序无响应。后来自己用C#写了一个客户端用来测试。已经用了线程池,不知道用法对不对。请大家帮忙看下。
服务端:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Net.Sockets;
using System.Net;
namespace consoleSocketServer
{
class Program
{
static int socketCount = 0;
static Socket serverSocket;
static Socket clientSocket;
public static int clientcount = 0;
public int clientnum = 0;
static int listSQL = 0;
static bool asy = true;
public static Int32 portServer = 0;
public static string ipServer = “”;
public static Thread threadSocketListen;
public static Thread threadDoWork;
public static Thread thr