client side of server not displaying output

edit::
the server is not displaying what the client is ending im shure it has somthing to do with these lines of code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include "tcplistener.h"

void Listener_MessageReceived(tcplistener* listener, int client, std::string msg);

int main()
{
	tcplistener server("127.0.0.1", 54010, Listener_MessageReceived)

	if (server.Init()) {
		server.Run();
	}

	system("pause");
	return 0;
}

void Listener_MessageReceived(tcplistener* listener, int client, std::string msg) {
	std::cout << msg << std::endl;
}
Last edited on
Why not just use a dynamic DNS service like no-ip?

It works like this. You sign up with a service (some are free if you don't have heavy traffic) and they give you a domain name; for example, reapersoul.zapto.org. Then you run in your server a program that they give you that periodically checks the current IP and, when it changes, connects to the DDNS service and they update the IP associated with your domain name.
Your client then, rather than specifying the IP it connects to, just specifies the domain name.
because i want to rout it myself i don't want there to be any middle men between me and the client
A DDNS doesn't route traffic through itself, it only performs the exact same function a normal DNS performs. That is, it resolves domain names to IP addresses. Once the client has resolved the IP address, it can connect directly to the server, just as if you had specified the IP address.
ok but i would still prefer to do it myself im stubborn and would like to figure out how to do it in my own code
Topic archived. No new replies allowed.