日期:2014-05-17 浏览次数:20880 次
class Program
{
static Thread t1 = new Thread(new ThreadStart(Run1));
static Thread t2 = new Thread(new ThreadStart(Run2));
static NetworkStream ns = null;
static byte[] data1 = new byte[99999];
static byte[] data2 = new byte[99999];
static void Main(string[] args)
{
for (int i = 0; i < data1.Length; i++)
{
data1[i] = 1;
}
TcpClient client = new TcpClient("127.0.0.1", 8855);
ns = client.GetStream();
t1.Start();
t2.Start();
}
static void Run1()
{
int i=100;//无意义
ns.Write(data1, 0, data1.Length);
}
static void Run2()
{
int i=1000;//无意义
ns.Write(data2, 0, data2.Length);
}
}