❔ open port through code
I want to make a multiplayer game where the clients can host a server on their computer and have people connect and play with them using the socket library but obviously unless this is done locally the router will not get the communication as the port will not be open. I don't want my players to have to manually open a port is it possible to do this through code
16 Replies
i want to be able to do this on all operating systems
I believe this is what UPnP is for
Otherwise there's no standard for getting routers to open a port
what is that
Universal Plug and Play
does they system library contain an implimentation of this
No
I'd suggest googling around for a library that can do it
ok
And also provide directions in case it's disabled on the router
i found another thing
this seemed like something https://learn.microsoft.com/en-us/dotnet/api/system.runtime.remoting.channels.tcp.tcpchannel?redirectedfrom=MSDN&view=netframework-4.8.1
TcpChannel Class (System.Runtime.Remoting.Channels.Tcp)
Provides a channel implementation that uses the TCP protocol to transmit messages.
Not what you're looking for
yeah i'm very new to networking as a whole
just want to find a way to play with it
Ignore all of System.Remoting
It's old, cursed RPC stuff from the early framework days
lol ok
thx
the majority of the librarys only work for windows machines
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.