Search Unity

Peer to peer packets (quick question)

Discussion in 'Multiplayer' started by FamishedMammal, Nov 22, 2019.

  1. FamishedMammal

    FamishedMammal

    Joined:
    Nov 3, 2015
    Posts:
    113
    Is there a way to send messages (packets) to a generic Unity app if you know what their IP is?
    I am not looking for a client-to-server setup, but a client-to-client system without having to portforward etc.

    I used to achieve this using UDP holepunching, but I was wondering if there are better methods to do this? A plugin perhaps?

    Thank you.
     
  2. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    Well the problem is you usually don't know what their IP is. You know what their NAT router's IP is, which won't know what to do with the packet unless it already has you in its connection table.

    The major approaches are hole punching (as you already mentioned), relay server, dedicated server, and a cloud service. The last 3 are just different variations of both clients connected to some server instead of connected to each other.
     
  3. FamishedMammal

    FamishedMammal

    Joined:
    Nov 3, 2015
    Posts:
    113
    Darn. Well, I want to implement a public database of IPs on my website ("active games"), which the client will scan through. Guess it's back to holepunching then?