Note that there are some explanatory texts on larger screens.

plurals
  1. POEstablish a P2P Connection in C#
    primarykey
    data
    text
    <p>I realize this question is similar <a href="https://stackoverflow.com/questions/4735869/regarding-p2p-connection-and-c">to</a> <a href="https://stackoverflow.com/questions/1183459/direct-p2p-connection">some</a> <a href="https://stackoverflow.com/questions/1146637/how-to-implement-p2p-in-c">others</a>, but I figured my situation is sufficiently different to warrant its own question (hopefully). </p> <p>What I'm planning on is deploying a program on another person's computer which will open a connection to my computer after which, I'm assuming, the computers should be able to communicate with each other. Once the program starts, it should be able to pull the address information and port (if they aren't blocked) to create a connection, right? </p> <p>What's more is the internet configuration of the dorm I'm living in. Every room is assigned a unique port and a static IP address assigned by a DHCP server. How do I factor this into the design of my program? </p> <p>I'm thinking that this setup does not require a server as an intermediate access point, as my address details will always remain the same and the host computer can simply connect to my computer without further information. Is this correct? </p> <p>Finally, I am reading a few pages about creating a connection, but am confused with all the possibilities of TcpConnection, WCF, CORBA, etc. Which one would actually be the simplest one for me to start with assuming I only want to send messages to the other machine? </p> <p><strong>Update:</strong></p> <p>The address is static in the sense that it doesn't change. My IP address is of the form 130.83.20.xxx and I can either wait for the DHCP server to assign me this address, or I can manually enter it myself using a static IP configuration. </p> <p>As for the messages itself, simple text messages will suffice for the start. The ports mentioned before are the switch ports and do not come into play during network programming I believe.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. COTo guide you, we'll need to know more about your objective. Depending on the nature of the data you need to send, TcpConnection might be good, but then maybe a simple WCF service would be better. I don't understand what you mean when you say each room is assigned a port and static ip... do you mean physical port, if so, that does not come into play during network programming. TCP/UDP Ports however, are important. You'll need to what ports are available for your use.
      singulars
    2. CO@Nate: Thanks for the heads up. For right now, I just want to test this program on a friend's computer and I think simple text messages such as, "Hello, how are you?" should be fine. Well, for example my IP address is 130.83.20.103 or something like that. It does not change. The DHCP server assigns me this address or I can manually enter it. Each room has a port that can be blocked by the central IT administration. These are the switch ports I believe.
      singulars
    3. COIf the DHCP server can assign you an IP address of `130.83.20.103` then you shouln't manually configure yourself to have that IP address. If you did and the DHCP server assigns that address to someone else then you would end up with an IP address conflict, and effectively a denial of service attack against the poor sucker who got given that IP address by the DHCP server.
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload