C# 服务器
using SimpleFramework.Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SimpleFramework.Utility;
namespace SimpleFramework.Message
{
///<summary>
///注册
///</summary>
classRegisters : IMessage
{
//创建字典存数据
publicstatic Dictionary<string, string> dic = new Dictionary<string, string>();
publicvoid OnMessage(ClientSession session, ByteBuffer buffer)
{
byte b =buffer.ReadByte();
ProtocalType type =(ProtocalType)b;
switch (type)
{
caseProtocalType.BINARY:
//传入方法
OnBinaryMessage(session,buffer);
break;
}
}
privatevoid OnBinaryMessage(ClientSession session, ByteBufferbuffer)
{
Console.WriteLine("注册请求123"