Sockets again :)
Can someone confirm something i think i allready got the answer to :)
My socket program:
Its going great. I have tried it on a local network and it works.
However, the next test was the internet. Here is the scenerio:
I am at home and connect to the net using a modem. I run the server side of the program here.
A mate of mine has my client program and is connected to the net with a modem aswell. I send him the ip address i am connected to the internet with. He types it in and cant get a connection haha.
Now, when i check my internet connection i got to ips.
The server ip(my provider) and the client(me) ip.
So my guess.....This will never work unless my program is running on my internet provides server.
to get it to work i need to use datagram sockets instedof stream sockets. This to enable a "peer to peer" connection and not having the connection running threw a server?
Ok, hope i am not confusing the hell out of you...
You don't have to use UDP. If all things are set correctly, it should work. What port are you listening to and what address are you bound to? How did you obtain your current IP address? Also, did you test his client program on your own computer to verify that it would work? Personally, I used web-browsers pointed to my loopback to test server code, and this seemed to be a good approach as far as debugging went. You might find that to be suitable too.
Yep i have testet it. I have testet it locally on my computer (running both server and clint from my mashine) and testet on a local network. e.g. connecting my computer to another and running client/server scenerio. It worked with both tests.
The port is random above 1024, and with the internet test thing i used the ip address the internet connection gives. e.g. there where two (server address, my provider and client address, the one asigned to me). I am running windowws 2000. I tried both of them. My server program connected and binded to (my client address) but myclient side program (at my mates house) coulnt get a connectoin. He was trying to connect to the ip address i sent him, which was the one i had binded to and was listening.
But anyway....i will figure it out. Good thing i dont need to rewrite the whole thing for dpackets....:)
Forgot to mention:
I have also testet locally with my internet connection. that is:
I connect to the net. Get my client address from there. e.g
18.104.22.168. I then use that address in my server program.
It binds sucessfully. I then run my client program and type in that address for the connection. It connects and i can run multiply clients all chatting and talking to each other nicely....
hehehe.....the program works. It worked all the time. My mate didnt enter ip correctly. duh....But i have tested it with others and its all happening. Cooool......
Ok...onwards and upwards......