Jump to content

Unable to create lan game, issue related to having hyper-v enabled virtual switch


Haze

Recommended Posts

Hi All,

I would like to report an issue I encoutered with CnCnet client. Whenever I try to host a game by clicking lan game and then clicking create game, I get an instant crash with the following messages:

Yuri's Revenge has crashed. Error message:

"An attempt was made to access a socket in a way forbidden by its access permissions"

"No connection could be made because the target machine actively refused it 127.0.0.1:1233"

I have figured that this only happens on a machine with Hyper-V enabled, and I suspect it might be due to the virtual switch. So let's say I need to have the virtual switch still on, is there a quick fix for this? I do not understand networking sufficiently to fix this.
 

Extracted from my client.log
Message: An attempt was made to access a socket in a way forbidden by its access permissions
31.05. 13:05:39.822    Source: System
31.05. 13:05:39.826    TargetSite.Name: DoBind
31.05. 13:05:39.832    Stacktrace:    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 DTAClient.DXGUI.Multiplayer.GameLobby.LANGameLobby.ListenForClients()
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()
31.05. 13:05:41.858    KABOOOOOOM!!! Info:
31.05. 13:05:41.858    Message: No connection could be made because the target machine actively refused it 127.0.0.1:1233
31.05. 13:05:41.866    Source: System
31.05. 13:05:41.866    TargetSite.Name: Connect
31.05. 13:05:41.877    Stacktrace:    at System.Net.Sockets.TcpClient.Connect(String hostname, Int32 port)
   at DTAClient.DXGUI.Multiplayer.GameLobby.LANGameLobby.SetUp(Boolean isHost, IPEndPoint hostEndPoint, TcpClient client)
   at DTAClient.DXGUI.Multiplayer.LANLobby.GameCreationWindow_NewGame(Object sender, EventArgs e)
   at DTAClient.DXGUI.Multiplayer.LANGameCreationWindow.BtnNewGame_LeftClick(Object sender, EventArgs e)
   at Rampastring.XNAUI.XNAControls.XNAControl.OnLeftClick()
   at Rampastring.XNAUI.XNAControls.XNAButton.OnLeftClick()
   at Rampastring.XNAUI.XNAControls.XNAControl.Update(GameTime gameTime)
   at Rampastring.XNAUI.XNAControls.XNAButton.Update(GameTime gameTime)
   at Rampastring.XNAUI.XNAControls.XNAControl.Update(GameTime gameTime)
   at Rampastring.XNAUI.XNAControls.XNAPanel.Update(GameTime gameTime)
   at Rampastring.XNAUI.XNAControls.XNAControl.Update(GameTime gameTime)
   at Rampastring.XNAUI.XNAControls.XNAPanel.Update(GameTime gameTime)
   at ClientGUI.DarkeningPanel.Update(GameTime gameTime)
   at Rampastring.XNAUI.XNAControls.XNAControl.Update(GameTime gameTime)
   at Rampastring.XNAUI.XNAControls.XNAPanel.Update(GameTime gameTime)
   at DTAClient.DXGUI.Multiplayer.LANLobby.Update(GameTime gameTime)
   at Rampastring.XNAUI.XNAControls.XNAControl.Update(GameTime gameTime)
   at Rampastring.XNAUI.XNAControls.XNAPanel.Update(GameTime gameTime)
   at ClientGUI.DarkeningPanel.Update(GameTime gameTime)
   at Rampastring.XNAUI.WindowManager.Update(GameTime gameTime)
   at Microsoft.Xna.Framework.Game.<.cctor>b__19(IUpdateable updateable, GameTime gameTime)
   at Microsoft.Xna.Framework.Game.SortingFilteringCollection`1.ForEachFilteredItem[TUserData](Action`2 action, TUserData userData)
   at Microsoft.Xna.Framework.Game.Update(GameTime gameTime)
   at Microsoft.Xna.Framework.Game.DoUpdate(GameTime gameTime)
   at Microsoft.Xna.Framework.Game.Tick()
   at MonoGame.Framework.WinFormsGameWindow.TickOnIdle(Object sender, EventArgs e)
   at System.Windows.Forms.Application.ThreadContext.System.Windows.Forms.UnsafeNativeMethods.IMsoComponent.FDoIdle(Int32 grfidlef)
   at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.Run(Form mainForm)
   at MonoGame.Framework.WinFormsGameWindow.RunLoop()
   at MonoGame.Framework.WinFormsGamePlatform.RunLoop()
   at Microsoft.Xna.Framework.Game.Run(GameRunBehavior runBehavior)
   at DTAClient.Startup.Execute()
   at DTAClient.PreStartup.Initialize(StartupParams parameters)
   at DTAClient.Program.Main(String[] args)
 

Edited by Haze
Added info
Link to comment
Share on other sites

On 5/25/2020 at 6:52 PM, Haze said:

Hi All,

I would like to report an issue I encoutered with CnCnet client. Whenever I try to host a game by clicking lan game and then clicking create game, I get an instant crash with the following messages:

Yuri's Revenge has crashed. Error message:

"An attempt was made to access a socket in a way forbidden by its access permissions"

"No connection could be made because the target machine actively refused it 127.0.0.1:1233"

I have figured that this only happens on a machine with Hyper-V enabled, and I suspect it might be due to the virtual switch. So let's say I need to have the virtual switch still on, is there a quick fix for this? I do not understand networking sufficiently to fix this.
 

bum.         p

Link to comment
Share on other sites

  • 3 weeks later...

Found the solution from here:

https://stackoverflow.com/questions/15619921/an-attempt-was-made-to-access-a-socket-in-a-way-forbidden-by-its-access-permissi

Just change 3001 to 1233

 

Disable Hyper-V:

dism.exe /Online /Disable-Feature:Microsoft-Hyper-V


After the required restarts, reserve the port you want so Hyper-V doesn't reserve it back:

netsh int ipv4 add excludedportrange protocol=tcp startport=1233 numberofports=1


Reenable Hyper-V:

dism.exe /Online /Enable-Feature:Microsoft-Hyper-V /All

 

Edited by Haze
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...