© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•4y ago•
20 replies
morry329#

❔ Address already in use after a kill process

My program keeps getting me this error
Unhandled exception. System.Net.Sockets.SocketException (48): Address already in use
   at System.Net.Sockets.Socket.UpdateStatusAfterSocketErrorAndThrowException(SocketError error, String callerName)
   at System.Net.Sockets.Socket.DoBind(EndPoint endPointSnapshot, SocketAddress socketAddress)
   at System.Net.Sockets.Socket.Bind(EndPoint localEP)
   at System.Net.Sockets.TcpListener.Start(Int32 backlog)
   at System.Net.Sockets.TcpListener.Start()
   at EinfacherWebserver.Program.Requests.Main(String[] args) in /Users/Program.cs:line 61
Unhandled exception. System.Net.Sockets.SocketException (48): Address already in use
   at System.Net.Sockets.Socket.UpdateStatusAfterSocketErrorAndThrowException(SocketError error, String callerName)
   at System.Net.Sockets.Socket.DoBind(EndPoint endPointSnapshot, SocketAddress socketAddress)
   at System.Net.Sockets.Socket.Bind(EndPoint localEP)
   at System.Net.Sockets.TcpListener.Start(Int32 backlog)
   at System.Net.Sockets.TcpListener.Start()
   at EinfacherWebserver.Program.Requests.Main(String[] args) in /Users/Program.cs:line 61

I tried 

I tried 
sudo kill -9 $(sudo lsof -t -i:3306)` but the error is still persistent. My full code here: https://pastebin.com/gXTwAu6S
Is there workaround other than restarting a computer?
Pastebin
Big Databank Server - Pastebin.com
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

❔ ✅ Kill Process
C#CC# / help
3y ago
How to kill a process ?
C#CC# / help
4y ago
✅ Failed to bind to address http://127.0.0.1:5196: address already in use
C#CC# / help
3y ago
Finding the base address of a memory string in a running process?
C#CC# / help
13mo ago