>>So in C++, using Something like Unix Sockets or Winsock with C++ lets you use things like TCP/IP. But it only lets you connect to an IP within your router when its by itself.
False. Try making the address something like this: "http://www.DaniWeb.com" and you can connnect to it via tcp/ip.
Ancient Dragon
Retired & Loving It
30,043 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,341
I strongly suggest using sdl_net for your socket work. I've found it to be a very nice cross-platform socket library, with quite a bit of functionality. It has a couple of quirks, but they are minor, and easy to work around.
As A.D. Suggested you would need to connect to daniweb.com, and then choose port 80... then you should connect, but you'll have to send an http request header... however, connecting directly out without needed to use an HTTP server... unless you are trying to work on some kind of proxyish, bypass firewall rule thing. In which case, I don't see why you don't just run the server on the web port (80 or 8080) anyway.
Comatose
Taboo Programmer
2,910 posts since Dec 2004
Reputation Points: 361
Solved Threads: 215
No. That's not what web-servers do. You can write a program that listens on port 80 (web port) and have that accept connections from clients. Then you can have that program send any data to any other connection.... what exactly are you trying to do?
Comatose
Taboo Programmer
2,910 posts since Dec 2004
Reputation Points: 361
Solved Threads: 215
I know what web servers do, I have my own website that is partly made up of pure HTML and Javascript.
Ok, so then you also know that web servers don't maintain a persistent connection. Which means that the connection doesn't stay alive. Which means as soon as the web server is done dishing out the web page to the client (or any information to the client) it immediately disconnects. So... let's follow this scenario:
1) you connect to the web server
2) buddy connects to web server
3) web server d/c you
4) buddy tries to send you a message, and is also d/c
5) web server..... does what? Sends you a message over a broken TCP connection?
Comatose
Taboo Programmer
2,910 posts since Dec 2004
Reputation Points: 361
Solved Threads: 215