I want to make a application P2P chat between 2 local networks but i don't know what i have to do ?
Please help me.thankz

3 Years
Discussion Span
Last Post by thanhdcbk

Can the two networks communicate with each other internally? If so, simply send data between each machine. If not, then you will need a central server to relay the chat. This won't be peer-peer though like you asked.

You can achieve both with UdpClient


yeah. P2P app in 2 local network. i think i need a central server but i don't understand why 2 clients haven't got global IP. what's it mean ??


I don't understand your usages of the terminology...
Global IP? Do you mean your internet facing IP Address?

You say they are on two networks; are these separated logically by subnet or physically wired to be separate entities?

Either way, if Computer A cannot talk to Computer B using its internal IP address, then you will need a central server that exists at a location that both machines can speak to.


my teacher say i have to use NAT or raw socket-send by MAC but i don't know how i can use??


You need to answer my previous question before I can suggest anything else.

NAT sounds like you have two networks with a router in between (so are on seperate networks completely)

If they are hidden behind a router, I'm not sure using RAW packets to the MAC address will work, as you only have the external facing MAC to address. Using NAT is is possible though. You need to look up UPnP; this way you can configure router port forwarding dynamically.

Both methods are relatively easy to implement.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.