Send a open port request to router [closed] - c#

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I am creating a peer to peer application in c sharp, I was wondering if it was possible to send a request to the other persons router over the internet and ask it to open port 1234, or if there is any other way of uploading and sending data without port forwarding, or even an application that i can port forward my router via command line or dll would be great. Please help me for this is making me frustrated.

There is no way for an outside app to tell a router to open a port to one of its local machines. This would be a huge security hole.
If a local machine wants access from outside, it could use UPnP (NAT Traversal) to tell the router to forward a port to it (or you could simply configure your router to forward the port).
If both peers are behind NAT with no access to port forwarding, you would have to use some 3rd party server that proxies the data.

Related

PC to a Raspberry-Pi via a TCP/IP socket? From C# to Python [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I am trying to do wireless communications between a PC and a Raspberry Pi using python's socket module. The problem is that the program on the PC is programmed in C# but the Raspberry-Pi is programmed in Python. How can I send a string from my computer so that the Raspberry Pi programmed in Python can read it?
A protocol like this is language-independent. That is one advantage of having such a concept.
If a server receives a connection request, it doesn't know or care what kind of code was used to create the connection and send the data (someone could even be typing it in by hand, in theory), all it cares about is that the data being sent is in the correct format (as defined by the protocol) and the messages follow the correct sequence etc, so that it can understand it.
This applies to all sorts of commonly-known protocols, such as TCP/IP sockets, or higher-level protocols which build on that, such as HTTP or FTP.
So as long as you know how to create code to initiate a socket connection in language A, and code to listen for connections in language B (or C or D, or even A again), then everything should work correctly.

How to send Audio/Video over internet to multiple clients? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I have designed a virtual classroom software for students with disabilities, it is being used by some local colleges. The limitation of the software is that the students within a Local Area Network (LAN) are able to connect with server in order to receive audio/video data. I have used sockets to connect clients with server. Now the demand for the software has increased and students outside of the LAN want to connect to server using their internet connection. I am aware that I have to rewrite the server/client connectivity modules, but I am not sure how to go about connecting clients to server using internet.
I think one way is to use a vpn but I am not really sure.
Any guidance would be much appreciated. Thanks in advance.
1)First, the good news: You may not have to rewrite your client server code (at least not completely)
2)This question may be better suited for serverfault
3)Get with your IT staff to discuss your needs. Developing the app without consulting them is asking for trouble, because they're going to be the ones to ensure the proper firewall ports are opened. Even if you had a VPN, without consulting them there's no guarantee it would even work. Because you would need
4)A routable IP address. Yes, DYNDNS or something similar would work, but that introduces another single point of failure. No IT staff? Then
5)Find an IT consultant knowledgeable in basic networking, or make heavy use of serverfault.

TCP between C# and C++ [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I'm creating a server that will in most/all cases be run on the same machine as the client. The client will need to be able to send and receive messages from this server. Some of the received messages will not be answers to questions (such as with http requests). All the messages will hold is a string that the project then uses to determine what function needs to be run.
The question is "Do I need to connect on two ports: one for sending and one for receiving?" If I use tcplistener with C# and C++ POSIX for networking, can I just send and receive messages on the same port?
Yes. You can send and receive on the same port and that's the intended way to communicate with tcp.
EDIT
You have two actors, a host and a client.
The host... will open a local network port (that you specify) and listen for new connections and communications from clients.
The client... can (and probably should) choose it's own local port and connect to the host on the port you specified.
Both the host and client... can communicate over the established connection. The host can send data to the client as long as the client is listening.
Have the server bind to and listen on a well-known port. Have the client bind to any port (you can let bind pick for you) and connect to the server on its port. Exchange messages.
Yeah, there isn't a difference between tcp/ip.

Server connection to client behind NAT [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I've made a server/client application in C#.
My question is the following: Let's say a client is behind an NAT (Like a router) and tries to connect to a server. From the server's perspective, the server only knows the client's external IP address. How do you determine exactly which computer to send the packets to that is behind an NAT? I understand port forwarding from the router on the client's end is a common way of solving these type of problems but if you look at applications like Skype, port forwarding is not necessary to properly establish a connection between the server and however many clients behind the NAT. This question can be asked vice-versa as well (I.E: client to server behind NAT).
I'm pretty new at socket programming so I'd love to hear any guidelines or materials that I can read over to fully understand this stuff.
You shouldn't worry about NAT in the application layer. If you receive a message with an IP say 200.51.255.79 you can send the answer to the same IP. Routers will handle the NAT and further routing automatically. It's not like this with port forwarding of course but it is with NAT.
Skype works in a very interesting way to get around port forwarding and firewalls using a server sided database of current ips and ports where each user is waiting for a response. You should look that up on the internet for a full explanation. It's a really good read =).

Send Message to remote PC in local network [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 1 year ago.
Improve this question
How can I in c# send Message box to remote computer? I have credentials of remote PC and know PC name. Can use for this purpose WMI?
Look into the NET SEND command. However, the messenger service needs to be enabled on the remote computer - you could use PSEXEC to start this.
I think you're asking how to send a message to a remote computer via c#. If so, you have several options see below:
Microsoft message queuing - Only if you need a super robust framework that gauarantees delivery of your message even if destination goes offline.
UDP multicast message - You can use the System.NET.Sockets namespace to send UDP packets and build a client to listen for them which can be run of n number of remote server. This is not error checking and if the remote server is not up then you are out of luck.
TCP socket connection - You can use the System.NET.Sockets namespace to send TCP packets and build a client to listen for them which can be run of n number of remote server. This is error checking and if the remote server is not up then you are out of luck.
Hope this gives you some direction.
Enjoy!

Categories