Skip to content

Commit 74251ac

Browse files
committed
added events.
1 parent e14a1ed commit 74251ac

8 files changed

Lines changed: 24 additions & 7 deletions

File tree

src/GodSharp.Socket/Abstractions/Components/ITcpClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
namespace GodSharp.Sockets
55
{
6-
public interface ITcpClient : INetBase<ITcpConnection>, IEvent<ITcpConnection, NetClientEventArgs<ITcpConnection>>, IDisposable
6+
public interface ITcpClient : INetBase<ITcpConnection>, ITcpClientEvents, IDisposable
77
{
88
ITcpConnection Connection { get; }
99
}

src/GodSharp.Socket/Abstractions/Components/ITcpServer.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,10 @@
55

66
namespace GodSharp.Sockets
77
{
8-
public interface ITcpServer : INetBase<ITcpConnection>, IEvent<ITcpConnection, NetServerEventArgs>, IDisposable
8+
public interface ITcpServer : INetBase<ITcpConnection>, ITcpServerEvents, IDisposable
99
{
1010
Socket Instance { get; }
1111

1212
IDictionary<string, ITcpConnection> Connections { get; }
13-
14-
SocketEventHandler<NetServerEventArgs> OnServerException { get; set; }
1513
}
1614
}

src/GodSharp.Socket/Abstractions/Components/IUdpClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
namespace GodSharp.Sockets
55
{
6-
public interface IUdpClient : INetBase<IUdpConnection>, IEvent<IUdpConnection, NetClientEventArgs<IUdpConnection>>, IDisposable
6+
public interface IUdpClient : INetBase<IUdpConnection>, IUdpClientEvents, IDisposable
77
{
88
IUdpConnection Connection { get; }
99
}

src/GodSharp.Socket/Abstractions/Events/IEvent.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace GodSharp.Sockets.Abstractions
44
{
5-
public interface IEvent<TConnection, TEventArgs> : IDisposable
5+
public interface IEvent<TConnection, TEventArgs>
66
where TConnection : INetConnection
77
where TEventArgs : NetEventArgs
88
{
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
namespace GodSharp.Sockets.Abstractions
2+
{
3+
public interface ITcpClientEvents: IEvent<ITcpConnection, NetClientEventArgs<ITcpConnection>>
4+
{
5+
}
6+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
namespace GodSharp.Sockets.Abstractions
2+
{
3+
public interface ITcpServerEvents : IEvent<ITcpConnection, NetServerEventArgs>
4+
{
5+
SocketEventHandler<NetServerEventArgs> OnServerException { get; set; }
6+
}
7+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
namespace GodSharp.Sockets.Abstractions
2+
{
3+
public interface IUdpClientEvents : IEvent<IUdpConnection, NetClientEventArgs<IUdpConnection>>
4+
{
5+
}
6+
}

src/GodSharp.Socket/Tcp/TcpConnection.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,4 +139,4 @@ private void ConnectCallback(IAsyncResult result)
139139

140140
public override void Dispose() => Listener?.Dispose();
141141
}
142-
}
142+
}

0 commit comments

Comments
 (0)