Skip to content

Commit

Permalink
remove named arguments (that weren't even needed anyway) for .net 3.5…
Browse files Browse the repository at this point in the history
… compliance
  • Loading branch information
gbirchmeier committed Feb 1, 2016
1 parent ecc3dd4 commit b6e2293
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 13 deletions.
2 changes: 1 addition & 1 deletion QuickFIXn/SocketInitiatorThread.cs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ protected int ReadSome(byte[] buffer, int timeoutMilliseconds)
{
// Begin read if it is not already started
if (currentReadRequest_ == null)
currentReadRequest_ = stream_.BeginRead(buffer, 0, buffer.Length, callback: null, state: null);
currentReadRequest_ = stream_.BeginRead(buffer, 0, buffer.Length, null, null);

// Wait for it to complete (given timeout)
currentReadRequest_.AsyncWaitHandle.WaitOne(timeoutMilliseconds);
Expand Down
4 changes: 2 additions & 2 deletions QuickFIXn/SocketReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public void Read()
{
try
{
int bytesRead = ReadSome(readBuffer_, timeoutMilliseconds: 1000);
int bytesRead = ReadSome(readBuffer_, 1000);
if (bytesRead > 0)
parser_.AddToStream(System.Text.Encoding.UTF8.GetString(readBuffer_, 0, bytesRead));
else if (null != qfSession_)
Expand Down Expand Up @@ -79,7 +79,7 @@ protected virtual int ReadSome(byte[] buffer, int timeoutMilliseconds)
{
// Begin read if it is not already started
if (currentReadRequest_ == null)
currentReadRequest_ = stream_.BeginRead(buffer, 0, buffer.Length, callback: null, state: null);
currentReadRequest_ = stream_.BeginRead(buffer, 0, buffer.Length, null, null);

// Wait for it to complete (given timeout)
currentReadRequest_.AsyncWaitHandle.WaitOne(timeoutMilliseconds);
Expand Down
2 changes: 1 addition & 1 deletion QuickFIXn/SocketSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public void Configure(QuickFix.Dictionary dictionary)
try
{
SslProtocol = (System.Security.Authentication.SslProtocols)
Enum.Parse(typeof(System.Security.Authentication.SslProtocols), protocolString, ignoreCase: true);
Enum.Parse(typeof(System.Security.Authentication.SslProtocols), protocolString, true);
}
catch (Exception)
{
Expand Down
12 changes: 3 additions & 9 deletions QuickFIXn/Transport/StreamFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public static Stream CreateClientStream(IPEndPoint endpoint, SocketSettings sett
var socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
socket.NoDelay = settings.SocketNodelay;
socket.Connect(endpoint);
Stream stream = new NetworkStream(socket, ownsSocket: true);
Stream stream = new NetworkStream(socket, true);

if (settings.UseSSL)
{
Expand Down Expand Up @@ -183,10 +183,7 @@ public SSLStreamFactory(ILog log, SocketSettings settings)
/// <returns>a ssl enabled stream</returns>
public Stream CreateClientStreamAndAuthenticate(Stream innerStream)
{
var sslStream = new SslStream(innerStream,
leaveInnerStreamOpen: false,
userCertificateValidationCallback: ValidateServerCertificate,
userCertificateSelectionCallback: SelectLocalCertificate);
var sslStream = new SslStream(innerStream, false, ValidateServerCertificate, SelectLocalCertificate);

try
{
Expand All @@ -213,10 +210,7 @@ public Stream CreateClientStreamAndAuthenticate(Stream innerStream)
/// <returns>a ssl enabled stream</returns>
public Stream CreateServerStreamAndAuthenticate(Stream innerStream)
{
var sslStream = new SslStream(innerStream,
leaveInnerStreamOpen: false,
userCertificateValidationCallback: ValidateClientCertificate,
userCertificateSelectionCallback: SelectLocalCertificate);
var sslStream = new SslStream(innerStream, false, ValidateClientCertificate, SelectLocalCertificate);

try
{
Expand Down

0 comments on commit b6e2293

Please sign in to comment.