Eabei.GoBangGame/Eabei.Net/TcpClientEx.cs
(开头部分) 4KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Sockets;
using System.Text;
using System.Threading.Tasks;
/********************************
* 命名空间: Eabei.Net
*
* 功 能: N/A
* 类 名: TcpClientEx
*
* 作 者: EB
* 创建日期: 2022/6/28 15:12:49
*********************************/
namespace Eabei.Net
{
public class TcpClientEx
{
public bool IsConnected => tcpClient == null ? false : tcpClient.Connected;
public string Host { get; private set; }
public int Port { get; private set; }
public string? RemoteEndPoint => tcpClient?.Client?.LocalEndPoint?.ToString();
private System.Net.Sockets.TcpClient tcpClient = null;
#region 事件
/// <summary>
/// 客户端连接事件
/// </summary>
public event EventHandler<ConnectionEventArgs> ClientConnectionHandle;
/// <summary>
/// 客户端断开事件
/// </summary>
public event EventHandler<CloseEventArgs> ClientDisConnectionHandle;
/// <summary>
/// 数据接收事件
/// </summary>
public event EventHandler<DataEventArgs> DataReceivedHandle;
/// <summary>
/// 数据发送之前发生
/// </summary>
public event EventHandler<DataEventArgs> DataSendingHandle;
/// <summary>
/// 数据发送之后发生
/// </summary>
public event EventHandler<DataEventArgs> DataSendedHandle;
/// <summary>
/// 普通异常事件
/// </summary>
public event Action<SocketException> ExceptionHandle;
后面还有 79 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。