Quote:Original post by ace_lovegrove
I don't know, basically with this i havnt much of a clue so any help is great. What do you mean by telnet servers.
ace
Uhhhoohh... You really don't have a clue do you?
Basicly it seems like your understandin on how networking works is a bit, well, let's say limited.
If you want to telnet to your local computer you need to have a server running on it. Else it will be like trying to phone someone who doesn't have a phone noone will answer no matter how hard you try.
So to be able to connect you need to start a server that listens on the port you want to connect to, that's what bind() and listen() functions does but fetch netcat just to get something running and you can start without having to write your own server.
And on the "won't it be occupied already" question, you're specifying the port to connect to not the port you connect from (that will get picked quite randomly by your OS if you don't force it to do otherwise). So no troubles there either.
google for beej's socket tutorial and you should find a decent treatment on socket programing in general.