- 2
- 0
- 约2.32万字
- 约 25页
- 2023-03-24 发布于天津
- 举报
c# tcp 调试助手源代码
以下是winform tcp 调试助手源代码,调试通过,可进行简单应用
using System;
using
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using
// ?加ó新 ?的 ?名 ?称 ?空 ?间 ?引皔用 ?
using System.IO;
using System.Net;
using
using System.Threading;
//using System.Timers;
namespace TCP 调獭 ?试 ?助ú手 ?
{
public partial class Form1 : Form
{
/***** ?端 ?*******/
private int serve_portNum=13 ;
private TcpListener serve_listener = null ;
// ?器÷与 ?客í户§机ú之 ?间 ?的 ?连 ?接ó状痢 ?态 ?
private bool bserve_Connected = false;
// ?器÷侦ì听瑈线 ?程ì
private Thread tserve_AcceptMsg = null ;
//网 ?络 ?访 ?问ê的 ?基ù础 ?数簓据 Y 流ⅰ ?
private NetworkStream nStream_serve = null;
//创洹 ?建¨读á取 ?器÷
private TextReader tReader_serve = null;
//创洹 ?建¨编括 ?写′器÷
private TextWriter wReader_serve = null;
/*****客í户§端 ?*******/
private int Client_portNum = 13;
//客í户§端 ?连 ?接ó
private TcpClient client_client = null ;
//客í户§机ú与 ? ?器÷之 ?间 ?的 ?连 ?接ó状痢 ?态 ?
private bool bclient_Connected = false;
//客í户§机ú侦ì听瑈线 ?程ì
private Thread tclient_AcceptMsg = null;
//网 ?络 ?访 ?问ê的 ?基ù础 ?数簓据 Y 流ⅰ ?
private NetworkStream nStream_client= null;
//创洹 ?建¨读á取 ?器÷
private TextReader tReader_client = null ;
//创洹 ?建¨编括 ?写′器÷
private TextWriter wReader_client = null ;
//接ó收 ?、¢发ぁ ?送í数簓据 Y 池 ?长¤度è
private const int bytelength = 1024;
// ?器÷接ó收 ?池 ?
byte [] serve_rec_buff = new byte [bytelength];
// ?器÷发ぁ ?送í池 ?
byte [] serve_send_buff = new byte [bytelength];
//客í户§端 ?接ó收 ?池 ?
byte [] client_rec_buff = new byte [bytelength];
//客í户§端 ?发ぁ ?送í池 ?
byte [] client_send_buf
原创力文档

文档评论(0)