C
C#2y ago
Dropps

✅ BenchmarkDotNet Error with Windows Defender

anyone knows how to fix this? windows defender isnt even running
7 Replies
Tvde1
Tvde12y ago
Scroll up, it will show the actual error
Dropps
Dropps2y ago
thanks alot i found it that way after reading the entirety in console... kinda doesnt help me tho as my ram is not the issue or anything here the exception
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
---> Grpc.Core.RpcException: Status(StatusCode="Unavailable", Detail="Error starting gRPC call. HttpRequestException: A socket operation could not be executed because the system lacked buffer memory or a queue was full. (localhost:5035) SocketException: A socket operation could not be performed because the system was
", DebugException="System.Net.Http.HttpRequestException: A socket operation could not be performed because the system lacked buffer space or a queue was full. (localhost:5035)
---> System.Net.Sockets.SocketException (10055): A socket operation could not be performed because the system lacked buffer space or a queue was full.
at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)
at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token)
at System.Net.Sockets.Socket.<ConnectAsync>g__WaitForConnectWithCancellation|277_0(AwaitableSocketAsyncEventArgs saea, ValueTask connectTask, CancellationToken cancellationToken)
at System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String host, Int32 port, HttpRequestMessage initialRequest, Boolean async, CancellationToken cancellationToken)
--- End of inner exception stack trace ---
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
---> Grpc.Core.RpcException: Status(StatusCode="Unavailable", Detail="Error starting gRPC call. HttpRequestException: A socket operation could not be executed because the system lacked buffer memory or a queue was full. (localhost:5035) SocketException: A socket operation could not be performed because the system was
", DebugException="System.Net.Http.HttpRequestException: A socket operation could not be performed because the system lacked buffer space or a queue was full. (localhost:5035)
---> System.Net.Sockets.SocketException (10055): A socket operation could not be performed because the system lacked buffer space or a queue was full.
at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)
at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token)
at System.Net.Sockets.Socket.<ConnectAsync>g__WaitForConnectWithCancellation|277_0(AwaitableSocketAsyncEventArgs saea, ValueTask connectTask, CancellationToken cancellationToken)
at System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String host, Int32 port, HttpRequestMessage initialRequest, Boolean async, CancellationToken cancellationToken)
--- End of inner exception stack trace ---
Ruttie
Ruttie2y ago
Are you creating a new socket every call? If so, don't.
Dropps
Dropps2y ago
iam running a grpc server and a client with the benchmarkdotnet stuff on my pc when i dont benchmark it it works but otherwise it just straight up does nothing i see in the server console tho that its getting used quite alot
Dropps
Dropps2y ago
using BenchmarkDotNet.Attributes;
using Domain.TestTypes;
using Google.Protobuf.WellKnownTypes;
using Grpc.Net.Client;
using gRPCTest.Server;

namespace gRPCTest.Client
{
public class ClientBenchmark
{
[Benchmark]
public async Task<TestResponse> TestResponse()
{
GrpcChannel channel = GrpcChannel.ForAddress("http://localhost:5035");
TestService.TestServiceClient client = new(channel);
TestAPIData testData = new();
TestRequest input = new()
{
IntValue = testData.IntValue,
LongValue = testData.LongValue,
DoubleValue = testData.DoubleValue,
FloatValue = testData.FloatValue,
GuidValue = testData.GuidValue.ToString(),
BoolValue = testData.BoolValue,
ByteArrayValue = testData.ByteArrayValue,
DateTimeValue = Timestamp.FromDateTime(testData.DateTimeValue),
TimeSpanValue = Duration.FromTimeSpan(testData.TimeSpanValue),
StringValue = testData.StringValue,
};
TestResponse response = await client.TestMethodAsync(input);
return response;
}
}
}
using BenchmarkDotNet.Attributes;
using Domain.TestTypes;
using Google.Protobuf.WellKnownTypes;
using Grpc.Net.Client;
using gRPCTest.Server;

namespace gRPCTest.Client
{
public class ClientBenchmark
{
[Benchmark]
public async Task<TestResponse> TestResponse()
{
GrpcChannel channel = GrpcChannel.ForAddress("http://localhost:5035");
TestService.TestServiceClient client = new(channel);
TestAPIData testData = new();
TestRequest input = new()
{
IntValue = testData.IntValue,
LongValue = testData.LongValue,
DoubleValue = testData.DoubleValue,
FloatValue = testData.FloatValue,
GuidValue = testData.GuidValue.ToString(),
BoolValue = testData.BoolValue,
ByteArrayValue = testData.ByteArrayValue,
DateTimeValue = Timestamp.FromDateTime(testData.DateTimeValue),
TimeSpanValue = Duration.FromTimeSpan(testData.TimeSpanValue),
StringValue = testData.StringValue,
};
TestResponse response = await client.TestMethodAsync(input);
return response;
}
}
}
this is the entire code that makes issues but i dont get why cause when i remove the [Benchmark] and test it manually with BloomRPC it works without issues oh iam a donkey... i realized the misstake now i create the client every time new instead of making it a setup variable thanks everyone | Method | Mean | Error | StdDev | |------------- |---------:|--------:|--------:| | TestResponse | 105.3 us | 2.07 us | 4.31 us | seems good now
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.