This repository has been archived by the owner on Feb 25, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Mark Eastwood
committed
Mar 18, 2019
1 parent
682ef61
commit 8d9c4ff
Showing
5 changed files
with
63 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,38 @@ | ||
using System; | ||
using Microsoft.Extensions.Logging; | ||
using Networker.Common.Abstractions; | ||
using Microsoft.Extensions.Logging; | ||
using Networker.Server.Abstractions; | ||
|
||
namespace Networker.Server | ||
{ | ||
public class DefaultUdpSocketListenerFactory : IUdpSocketListenerFactory | ||
{ | ||
private readonly ILogger<UdpClientListener> logger; | ||
private readonly ServerBuilderOptions options; | ||
private readonly IServerPacketProcessor serverPacketProcessor; | ||
private IServerInformation serverInformation; | ||
public class DefaultUdpSocketListenerFactory : IUdpSocketListenerFactory | ||
{ | ||
private readonly ILogger<UdpClientListener> logger; | ||
private readonly ServerBuilderOptions options; | ||
private readonly IServerPacketProcessor serverPacketProcessor; | ||
private IUdpSocketListener _clientListener; | ||
private readonly IServerInformation serverInformation; | ||
|
||
public DefaultUdpSocketListenerFactory(ServerBuilderOptions options, | ||
ILogger<UdpClientListener> logger, | ||
IServerPacketProcessor serverPacketProcessor, | ||
IServerInformation serverInformation) | ||
{ | ||
this.options = options; | ||
this.logger = logger; | ||
this.serverPacketProcessor = serverPacketProcessor; | ||
this.serverInformation = serverInformation; | ||
} | ||
public DefaultUdpSocketListenerFactory(ServerBuilderOptions options, | ||
ILogger<UdpClientListener> logger, | ||
IServerPacketProcessor serverPacketProcessor, | ||
IServerInformation serverInformation) | ||
{ | ||
this.options = options; | ||
this.logger = logger; | ||
this.serverPacketProcessor = serverPacketProcessor; | ||
this.serverInformation = serverInformation; | ||
} | ||
|
||
public IUdpSocketListener Create() | ||
{ | ||
/*return new UdpSocketListener(this.options, | ||
this.logger, | ||
this.serverPacketProcessor, | ||
this.bufferManager);*/ | ||
public IUdpSocketListener Create() | ||
{ | ||
/*return new UdpSocketListener(this.options, | ||
this.logger, | ||
this.serverPacketProcessor, | ||
this.bufferManager);*/ | ||
|
||
return new UdpClientListener(this.options, | ||
this.logger, | ||
this.serverPacketProcessor, | ||
this.serverInformation); | ||
} | ||
} | ||
return _clientListener ?? (_clientListener = new UdpClientListener(options, | ||
logger, | ||
serverPacketProcessor, | ||
serverInformation)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters