Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RakNet binds to loopback addresses? #36

Open
aardvarkk opened this issue Jun 21, 2016 · 2 comments
Open

RakNet binds to loopback addresses? #36

aardvarkk opened this issue Jun 21, 2016 · 2 comments

Comments

@aardvarkk
Copy link

After setting up a server running RakNet, I run the following code:

    peer->GetSockets(sockets);
    for (auto i = 0; i < sockets.Size(); ++i)
        LOG(INFO) << "Bound to address " << peer->GetMyBoundAddress(i).ToString();

The output is the following (I set up one port for IPv4 and one port for IPv6):

2016-06-21 20:11:07,450 INFO  Bound to address 127.0.0.1|1111
2016-06-21 20:11:07,460 INFO  Bound to address ::1|1112

What I find incredibly strange is that RakNet has bound to the loopback address. However, the server seems to work and does accept connections. My two questions are:

  1. Why is RakNet binding to the loopback instead of the ethernet addresses?
  2. How does anything even get through to the server? Since it's bound to the loopback address, wouldn't it only receive packets generated on the same machine?
@Kiddinglife
Copy link

because in lan, loopback addr is same to your local ethernet addr. thay is 127.0.0.1 is same to 192.168.1.107 both of them are your local address.
2.
No, senddata to 127.0.0.1 is only called by you, other people in lan would send data to 192.168.1.107.

@Kiddinglife
Copy link

go over book of unix network programming

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants