日期:2014-05-17 浏览次数:20877 次
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Threading;
using System.Net;
using System.Net.Sockets;
using System.IO;
using System.Collections;
using System.Text.RegularExpressions;
using System.Runtime.InteropServices;
using Shell32;
using AviFile;
namespace media
{
public partial class Show : Form
{
public static ManualResetEvent allDone = new ManualResetEvent(false);
Thread serverThread;
Thread clientThread;
Socket serverSocket;
Socket clientSocket;
public Show()
{
InitializeComponent();
}
private Thread threadWatch = null;//负责监听客户端连接请求的线程
private Socket socketWatch = null;//负责监听的套接字
private void ServerStart()
{
IPEndPoint localipep = new IPEndPoint(IPAddress.Any, 6000);
serverSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
//将所创建的套接字与IPEndPoint绑定
serverSocket.Bind(localipep);