Skip to content

Commit

Permalink
PR feedback round dotnet#1
Browse files Browse the repository at this point in the history
  • Loading branch information
Paulo Janotti committed Feb 26, 2018
1 parent 73574ee commit 4c03e6a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/System.IO.Pipes/src/Resources/Strings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,6 @@
<value>Could not connect to the pipe because it was not owned by the current user.</value>
</data>
<data name="UnauthorizedAccess_ClientIsNotCurrentUser" xml:space="preserve">
<value>Client connection refused because it was not owned by the current user.</value>
<value>Client connection (user id {0}) was refused because it was not owned by the current user (id {1}).</value>
</data>
</root>
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ private void HandleAcceptedSocket(Socket acceptedSocket)

if (serverEUID != peerID)
{
throw new UnauthorizedAccessException(SR.UnauthorizedAccess_ClientIsNotCurrentUser);
throw new UnauthorizedAccessException(string.Format(SR.UnauthorizedAccess_ClientIsNotCurrentUser, peerID, serverEUID));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public static void CreateServer_CurrentUserOnly()
[Fact]
public static void CreateServer_ConnectClient()
{
var name = GetUniquePipeName();
string name = GetUniquePipeName();
using (var server = new NamedPipeServerStream(name, PipeDirection.InOut, 1, PipeTransmissionMode.Byte, PipeOptions.CurrentUserOnly))
{
using (var client = new NamedPipeClientStream(".", name, PipeDirection.InOut, PipeOptions.CurrentUserOnly))
Expand All @@ -45,7 +45,7 @@ public static void CreateServer_ConnectClient()
[PlatformSpecific(TestPlatforms.AnyUnix)] // On Unix domain socket should have different location in this case.
public static void CreateServerNotCurrentUserOnly_ClientCurrentUserOnly_ThrowsTimeout_OnUnix()
{
var name = GetUniquePipeName();
string name = GetUniquePipeName();
using (var server = new NamedPipeServerStream(name, PipeDirection.InOut, 1, PipeTransmissionMode.Byte))
{
using (var client = new NamedPipeClientStream(".", name, PipeDirection.InOut, PipeOptions.CurrentUserOnly))
Expand All @@ -58,9 +58,9 @@ public static void CreateServerNotCurrentUserOnly_ClientCurrentUserOnly_ThrowsTi
[Fact]
public static void CreateMultipleServers_ConnectMultipleClients()
{
var name1 = GetUniquePipeName();
var name2 = GetUniquePipeName();
var name3 = GetUniquePipeName();
string name1 = GetUniquePipeName();
string name2 = GetUniquePipeName();
string name3 = GetUniquePipeName();
using (var server1 = new NamedPipeServerStream(name1, PipeDirection.InOut, 1, PipeTransmissionMode.Byte, PipeOptions.CurrentUserOnly))
using (var server2 = new NamedPipeServerStream(name2, PipeDirection.InOut, 1, PipeTransmissionMode.Byte, PipeOptions.CurrentUserOnly))
using (var server3 = new NamedPipeServerStream(name3, PipeDirection.InOut, 1, PipeTransmissionMode.Byte, PipeOptions.CurrentUserOnly))
Expand Down

0 comments on commit 4c03e6a

Please sign in to comment.