1 Star 0 Fork 0

ircove / VFPush

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
ISimplSocketClient.cs 1.99 KB
一键复制 编辑 原始数据 按行查看 历史
ircove 提交于 2018-03-07 19:14 . 第一次提交
/*****************************
* Author: YanNI
* Create:2018/3/7 14:26:32
* Email: admin@ircove.com
* QQ: 401608886
* TEl: 13520446271
****************************/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
namespace VFPush
{
/// <summary>
/// Represents a client socket.
/// </summary>
public interface ISimplSocketClient : IDisposable
{
/// <summary>
/// Connects to an endpoint. Once this is called, you must call Close before calling Connect again.
/// </summary>
/// <param name="endPoint">The endpoint.</param>
/// <returns>true if connection is successful, false otherwise.</returns>
bool Connect(EndPoint endPoint);
/// <summary>
/// Sends a message to the server without waiting for a response (one-way communication).
/// </summary>
/// <param name="message">The message to send.</param>
void Send(byte[] message);
/// <summary>
/// Sends a message to the server and then waits for the response to that message.
/// </summary>
/// <param name="message">The message to send.</param>
/// <returns>The response message.</returns>
byte[] SendReceive(byte[] message);
/// <summary>
/// Closes the connection. Once this is called, you can call Connect again to start a new client connection.
/// </summary>
void Close();
/// <summary>
/// An event that is fired whenever a message is received. Hook into this to process messages and potentially call Reply to send a response.
/// </summary>
/// event EventHandler<MessageReceivedArgs> MessageReceived;
/// <summary>
/// An event that is fired whenever a socket communication error occurs. Hook into this to do something when communication errors happen.
/// </summary>
/// event EventHandler<SocketErrorArgs> Error;
}
}
C#
1
https://gitee.com/ircove/VFPush.git
git@gitee.com:ircove/VFPush.git
ircove
VFPush
VFPush
master

搜索帮助