52 lines
1.5 KiB
C#
52 lines
1.5 KiB
C#
|
using SuperSocket.SocketBase;
|
|||
|
using SuperSocket.SocketBase.Config;
|
|||
|
using SuperSocket.SocketBase.Protocol;
|
|||
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.Linq;
|
|||
|
using System.Text;
|
|||
|
using System.Threading.Tasks;
|
|||
|
|
|||
|
namespace Chat.Framework.PCRobotSDK
|
|||
|
{
|
|||
|
/// <summary>
|
|||
|
///
|
|||
|
/// </summary>
|
|||
|
public class SupperSocketSession : AppSession<SupperSocketSession, StringRequestInfo>
|
|||
|
{
|
|||
|
|
|||
|
}
|
|||
|
public class AppServer : AppServer<SupperSocketSession>
|
|||
|
{
|
|||
|
|
|||
|
// public TestServer() : base(new CommandLineReceiveFilterFactory(Encoding.UTF8, new BasicRequestInfoParser(":", ",")))
|
|||
|
public AppServer() : base(new CommandLineReceiveFilterFactory(Encoding.UTF8, new BasicRequestInfoParser(" ", ",")))
|
|||
|
{
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
protected override bool Setup(IRootConfig rootConfig, IServerConfig config)
|
|||
|
{
|
|||
|
return base.Setup(rootConfig, config);
|
|||
|
}
|
|||
|
protected override void OnNewSessionConnected(SupperSocketSession session)
|
|||
|
{
|
|||
|
//Console.WriteLine($"{session.SessionID} Connected");
|
|||
|
base.OnNewSessionConnected(session);
|
|||
|
}
|
|||
|
|
|||
|
protected override void OnSessionClosed(SupperSocketSession session, CloseReason reason)
|
|||
|
{
|
|||
|
|
|||
|
//Console.WriteLine($"{session.SessionID} Closed CloseReason {reason.ToString()}");
|
|||
|
base.OnSessionClosed(session, reason);
|
|||
|
}
|
|||
|
protected override void OnStarted()
|
|||
|
{
|
|||
|
Console.WriteLine($"OnStarted");
|
|||
|
base.OnStarted();
|
|||
|
|
|||
|
}
|
|||
|
}
|
|||
|
}
|