All Questions
417
questions
0
votes
0
answers
15
views
Reading GPD serial port in C# gives me random text
Trying to read GPS device location using code below:
using System;
using System.IO.Ports;
public class Program
{
public static SerialPort? _serialPort;
public static SerialPort? ...
1
vote
1
answer
139
views
How to handle inconsistent HttpRequestExceptions when calling external API from web application
While trying to call an external API from react/.NET applications using HttpClient in the background, sometimes we are seeing http exceptions like this:
System.Net.Http.HttpRequestException: A ...
-1
votes
1
answer
62
views
Change the port of a Process(WIn11)
For my Coding project I need my application running on localhost:5000 since everything else was set up around that. After starting my backend it said the address is already in use, which I checked: ...
0
votes
0
answers
23
views
Http request c# how to get external ip when request completed
I try to get ip and port from request which completed and Idk how to do it
Problem:
I have router in which I configure that from adress1 to adress2 I want to send from first external ip
From adress1 ...
0
votes
0
answers
18
views
Trying to pre-register ports to run Owin without Admin doesn't work
Currently working on a PoC of sorts to find out if I can run Owin self-host without admin rights if I do port/url/firewall stuff with admin rights before execution of the app.
For this purpose I have ...
0
votes
1
answer
118
views
How to open Google VM to external HTTP connection?
I'm trying to make a simple C# HTTP Listener that listens for external connections. I installed dotnet on the VM Instance(uses Ubuntu 22.04 by the way), and uploaded my source files for the HTTP ...
1
vote
1
answer
117
views
How To Prevent Port Sharing With Kestrel?
On my Windows machine, I'm struggling to understand the behavior I'm seeing with Kestrel and asp.net core with regards to port conflicts with other processes on the machine. I want to prevent a ...
0
votes
0
answers
28
views
Why is my device marked as unknown device when using "Mono.Nat.NatUtility.StartDiscovery()"?
I'm using Unity to make a simple coop game for me and my friends, I saw that using Mono.Nat I could port forward without making the user do it manually, but when I tested it, my PC is always found as ...
0
votes
0
answers
45
views
Why SerialPort_DataReceived not raise in a worker thread
I created a serial port singleton worker thread with:
builder.Services.AddHostedService<SerialPortSingleton>();
builder.Services.AddSingleton(x => x.GetServices<IHostedService>()
...
0
votes
0
answers
315
views
how to spawn multiple instances of web api in c#?
I'm trying to implement a basic load balancing only on the instances level which means that all the instances are hosted in the same server, however every time I start a second instance of my api I ...
0
votes
0
answers
46
views
Trying to make a simple chat on local network with TcpClient and TcpListener in C#
This is my code. when running this on 2 different computers they just can't connect one to the other
Code for computer 1
using System;
using System.Text;
using System.Threading;
using System.Net....
0
votes
1
answer
991
views
How to resolve "SocketException" access denied?
I am trying to make my ASP.NET Core (.NET 6.0) application bind to a fixed port that is 49913. I have set this up using the launchSettings.json (for debugging) and appsettings.json (for release) as ...
0
votes
0
answers
36
views
Running three python scripts at the same time in a C# application
I want to run three python scripts that receives images and Json files from a client through different ports using socket programming in a C# application. I run these scripts as three separate ...
1
vote
0
answers
178
views
Remove ComPort from current ports after it has been disconnected - C#
I have an app that manages multiple serialports. It should show what ports are currently connected. For detecting the current ports I use SerialPort.GetPortNames();. This works fine, if the port is ...
0
votes
0
answers
29
views
ASP.NET Determine executed port number of site (C#, IIS, NET6) [duplicate]
I need to find out the port number of my ASP.NET application. It is hosted by an IIS and I need to determine the port number (e.g. "7535" in example "http://test.com:7535"). ...