Skip to content
This repository has been archived by the owner on Jun 16, 2022. It is now read-only.

Commit

Permalink
Work to simplify session usage.
Browse files Browse the repository at this point in the history
  • Loading branch information
DJGosnell committed Sep 27, 2016
1 parent e352f54 commit 6aa8144
Show file tree
Hide file tree
Showing 15 changed files with 477 additions and 418 deletions.
3 changes: 2 additions & 1 deletion src/DtronixMessageQueue/DtronixMessageQueue.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,10 @@
<Compile Include="MqSession.cs" />
<Compile Include="MqConfig.cs" />
<Compile Include="Rpc\DataContract\RpcServerInfoDataContract.cs" />
<Compile Include="Rpc\IProcessRpcSession.cs" />
<Compile Include="Rpc\IRemoteService.cs" />
<Compile Include="Rpc\MessageHandler.cs" />
<Compile Include="Rpc\RpcAuthEventArgs.cs" />
<Compile Include="Rpc\RpcCallMessageHandler.cs" />
<Compile Include="Rpc\RpcClient.cs" />
<Compile Include="Rpc\RpcCommandType.cs" />
<Compile Include="Rpc\RpcConfig.cs" />
Expand Down
7 changes: 1 addition & 6 deletions src/DtronixMessageQueue/MqSession.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace DtronixMessageQueue {
/// </summary>
/// <typeparam name="TSession">Session type for this connection.</typeparam>
/// <typeparam name="TConfig">Configuration for this connection.</typeparam>
public abstract class MqSession<TSession, TConfig> : SocketSession<TConfig>
public abstract class MqSession<TSession, TConfig> : SocketSession<TSession, TConfig>
where TSession : MqSession<TSession, TConfig>, new()
where TConfig : MqConfig {

Expand Down Expand Up @@ -52,11 +52,6 @@ public abstract class MqSession<TSession, TConfig> : SocketSession<TConfig>
/// </summary>
public event EventHandler<IncomingMessageEventArgs<TSession, TConfig>> IncomingMessage;

/// <summary>
/// Base socket for this session.
/// </summary>
public SocketBase<TSession, TConfig> BaseSocket { get; set; }

protected override void OnSetup() {
frame_builder = new MqFrameBuilder(Config);
}
Expand Down
20 changes: 0 additions & 20 deletions src/DtronixMessageQueue/Rpc/IProcessRpcSession.cs

This file was deleted.

20 changes: 20 additions & 0 deletions src/DtronixMessageQueue/Rpc/MessageHandler.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DtronixMessageQueue.Rpc {
public abstract class MessageHandler<TSession, TConfig>
where TSession : RpcSession<TSession, TConfig>, new()
where TConfig : RpcConfig {

protected TSession Session;

protected MessageHandler(TSession session) {
Session = session;
}

public abstract bool HandleMessage(MqMessage message);
}
}
Loading

0 comments on commit 6aa8144

Please sign in to comment.