Thread: How to open a connection to a host:port?

  1. #1
    Registered User
    Join Date
    Dec 2001
    Posts
    2

    How to open a connection to a host:port?

    Can someone explain to me what commands to use that will allow me to do the following (if possible) in C:

    1) Open a telnet session to an IP address & port

    2) Send commands to the opened port.

    3) Receive responses from the port.


    Thanks!

  2. #2
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    1) www.google.com
    2) www.google.com
    3) www.google.com

    Ever heard of a search engine?

    Beej is your friend.

    Quzah.
    Hope is the first step on the road to disappointment.

  3. #3
    Unregistered
    Guest

    Thumbs down This is not a way to reply to a post

    Beej,

    Your www.google.com response on a question "how to open a telnet session" is no where close to what one will expect from a senior member here. This is my first visit here, and i felt really bad reading your post. If you do not know how to respond to a newbie questions, do not post replies.

    Regards,
    Rahul

  4. #4
    Registered User Twiggy's Avatar
    Join Date
    Oct 2001
    Posts
    43
    I agree with him. It all falls back under the rule, if you don't have anything good to say. Don't say anything at all. I for one don't need to read your sarcasm.
    To error is human, to really foul things up requires a computer

  5. #5
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    I do have something nice to say: kiss my ass.

    Beej's guide is _THE_ universal guide to socket programming. I gave you _THE_ link. I'm not going to write you a telnet server and explain it step by step when Beej has already done it. I gave you the link, I'm not paid, this isn't my JOB, this is something I do in my free time.

    You apparently have made no effort to try and search on your own, or you'd have found it in less than a minute in any search engine. Simply put in: "socket programming" and you'll get a TON of links.

    Again, I gave you _THE_ athourity as far as basic guides are concerned. Ask anyone and they'll all recommend Beej's guide.

    Quzah.
    Hope is the first step on the road to disappointment.

  6. #6
    Registered User
    Join Date
    Dec 2001
    Posts
    2
    Thanks for the info, but the sarcasm I could do without.

  7. #7
    Registered User Twiggy's Avatar
    Join Date
    Oct 2001
    Posts
    43
    Kiss your ass? Why don't you bite me. Your about the only idiot in these boards who actually has that kind of attitude. I've found everyone here quite helpful and kind. If your that deranged and have some sort of self-esteem problem you have to try and make fun of people for trying to learn, then I suggest you just not post here. I for one don't need to hear your ramblings when people ask questions they expect help or suggestions, not smart ass remarks.

    --Twigg
    To error is human, to really foul things up requires a computer

  8. #8
    Registered User *pointer's Avatar
    Join Date
    Oct 2001
    Posts
    74
    I don't know what you people are talking about, quzah always answers your questions in a knowledgeable way. His attitude in doing so doesn't matter as long as you get the information that you ask for.
    Personally, I'd rather have quzah helping out with an attitude than to miss out on tapping his knowledge.
    pointer = NULL

  9. #9
    Hamster without a wheel iain's Avatar
    Join Date
    Aug 2001
    Posts
    1,385
    children, children!!

    How do you intend to communicate with the other machine?
    serial, parralell, ethernet or via modem

    If serial/paraell you can use fopen(0 to open the port and write a simple transmit system - if ethernet or modem you need to look at sockets - post back some more info
    Monday - what a way to spend a seventh of your life

  10. #10
    Registered User
    Join Date
    Dec 2001
    Posts
    4
    I'm gonna have to go with quzah on this one. Socket programming is fairly easy to find information about it if you take a little time. It's like all your teachers tell ya... don't ask before you haven't looked yourself! I remember searching for sockets on google, and I think BEEJ's was one of the first ones to come up. As for sarcasm... does it really matter? It's online guys... don't take it too seriously, if you're seriously offended by something, well, don't be.

  11. #11
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    I for one don't need to hear your ramblings when people ask questions they expect help or suggestions, not smart ass remarks.
    People EXPECT me to write their homework. People EXPECT everyone here to instantly answer their question. People EXPECT to have their problem's solution handed to them on a silver platter. People EXPECT a lot of things that are not reality.

    Now here's what I EXPECT:

    1) You actually read the "READ THIS" post.
    2) You actually read the FAQ.
    3) You actually TRY to make an effort on your own.
    4) You actually do some research before asking for an answer.

    Now we both know, no one ever gets what they expect.

    My first reply gave all the answers the original poster needed. He didn't even bother clicking on the link I provided. I EXPECT people to actually pay heed to a CORRECT answer. But again, what we expect and what is reality are two things entirely different.

    People come here every single day and post: 'how do i clear the screen'? Every day. Without fail. People every day say 'I need this function. I need this program.' without even bothering to try.

    Once again: I provided the answer in my very first post. What happened? Since it wasn't sugar coated enough, they didn't even bother looking.

    Now I ask you: why should I even bother?

    Quzah.
    Hope is the first step on the road to disappointment.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Winsock connection problem
    By Nephiroth in forum C++ Programming
    Replies: 2
    Last Post: 02-07-2006, 07:54 AM
  2. Big help in Astar search code...
    By alvifarooq in forum C++ Programming
    Replies: 6
    Last Post: 09-24-2004, 11:38 AM
  3. Unknown Memory Leak in Init() Function
    By CodeHacker in forum Windows Programming
    Replies: 3
    Last Post: 07-09-2004, 09:54 AM
  4. how do u open a folder?
    By nicola_diaz in forum C++ Programming
    Replies: 3
    Last Post: 11-24-2001, 04:22 PM
  5. Ghost in the CD Drive
    By Natase in forum A Brief History of Cprogramming.com
    Replies: 17
    Last Post: 10-12-2001, 05:38 PM