Home Help Center

UDP connection message

soff.dongsoff.dong Member qiao dongOrganization: accuradProject: v6's net project ✭✭
I try to get connect info from Ice::Current,but i found cur.con->toString()
can get really info,but datagram can't.
Info like this:
TCP:
local address = 192.168.0.75:10000
remote address = 124.114.173.58:57979
UDP:
local address = 0.0.0.0:10000
remote address = <not connected>


How to get the right info when use datagram?

Comments

  • matthewmatthew NL, CanadaMember Matthew NewhookOrganization: ZeroC, Inc.Project: Internet Communications Engine ✭✭✭
    On the server side you cannot get the client side address with a UDP endpoint, since UDP endpoints are not bound to any particular client. I'm not sure why you are not getting the server side IP address. What platform, Ice version and endpoint configuration are you using?
  • soff.dongsoff.dong Member qiao dongOrganization: accuradProject: v6's net project ✭✭
    ICE3.3.1,I use C:\Ice-3.3.1-VC90\demo\Ice\MFC,
    server config:
    Hello.Endpoints=tcp -p 10000:udp -p 10000:ssl -p 10001

    changed it like this,but fail same too.
    iHello.Endpoints=tcp -h192.168.1.100 -p 10000:udp -p 10000:ssl -p 10001

    I try to get it to make "UDP Hole Punching", it's always used for P2P,ICE can do it?
  • soff.dongsoff.dong Member qiao dongOrganization: accuradProject: v6's net project ✭✭
    ICE3.3.1,I use C:\Ice-3.3.1-VC90\demo\Ice\MFC,
    server config:
    Hello.Endpoints=tcp -p 10000:udp -p 10000:ssl -p 10001

    changed it like this,but fail same too.
    iHello.Endpoints=tcp -h192.168.1.100 -p 10000:udp -p 10000:ssl -p 10001

    I try to get it to make "UDP Hole Punching", it's always used for P2P,ICE can do it?
  • matthewmatthew NL, CanadaMember Matthew NewhookOrganization: ZeroC, Inc.Project: Internet Communications Engine ✭✭✭
    Hello.Endpoints=tcp -p 10000:udp -p 10000:ssl -p 10001
    

    This reports:
    local address = 0.0.0.0:10000
    remote address = <not connected>
    

    That is correct, since if you don't have the -h option, the udp endpoint is bound to 0.0.0.0 (meaning all interfaces). If you want to bind to a specific interface for udp, then you must specify the -h option for the udp endpoint. In your case, you need at a minimum:
    Hello.Endpoints=udp -h 192.168.1.100 -p 10000
    

    I don't think, however, with Ice it will be directly possible to do NAT hole punching, as you cannot determine the sender IP address for UDP endpoints.
  • soff.dongsoff.dong Member qiao dongOrganization: accuradProject: v6's net project ✭✭
    yeah,i change it and i get
    oneway TCP:
    local address = 192.168.1.100:10000
    remote address = 192.168.1.100:22175

    datagram UDP:
    local address = 192.168.1.100:10000
    remote address = <not connected>

    still can't get remote address , i can get IP in other way,but how to get the port?it's same to 22175?

    and how ice can do NAT hole punching?Glaceier2?
  • soff.dongsoff.dong Member qiao dongOrganization: accuradProject: v6's net project ✭✭
    yeah,i change it and i get
    oneway TCP:
    local address = 192.168.1.100:10000
    remote address = 192.168.1.100:22175

    datagram UDP:
    local address = 192.168.1.100:10000
    remote address = <not connected>

    still can't get remote address , i can get IP in other way,but how to get the port?it's same to 22175?

    and how ice can do NAT hole punching?Glaceier2?
Sign In or Register to comment.