Thread: gethostbyname and structs

  1. #31
    * Death to Visual Basic * Devil Panther's Avatar
    Join Date
    Aug 2001
    Posts
    768
    no problem
    "I don't suffer from insanity but enjoy every minute of it" - Edgar Allen Poe

    http://www.Bloodware.net - Developing free software for the community.

  2. #32
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Did you even read Beej's guide? Somehow I doubt it.

    READ ME

    You don't bind to a socket with the client, because all you do is go ask for a connection. The server has already bound to a port and sits there listening on it for an incoming connect request.

    People that come here for help but don't even pay attention when they're given one of the best resources out there really annoy me. I mean really, why even ask if you don't care enough to follow the advice you were given?

    "Ok, I'm going to ask for help, but I'm going to pretty much ignore what you all suggest until I hear an answer I like enough to follow."

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

  3. #33
    UNIX chick
    Join Date
    Mar 2003
    Posts
    92
    Um, I actually did read most of it, though I didn't read everything that well. I also skippet the last parts (part > 5), and mostly used it as a reference to the functions. I don't like people insinuating that I didn't do something I did do. I already said I wasn't good at network programming! If people think I didn't read it at all, and don't want to help; that's ok, its a forum and no-one is forced to reply to someone's thread!

  4. #34
    * Death to Visual Basic * Devil Panther's Avatar
    Join Date
    Aug 2001
    Posts
    768
    Quote Originally Posted by quzah
    You don't bind to a socket with the client, because all you do is go ask for a connection. The server has already bound to a port and sits there listening on it for an incoming connect request.
    quzah, i don't agree with you on the bind... you can bind a client to a local port, it's just simply not done, because there is no real need, but it's a posibility.

    also why attack someone just because they don't understand, since this is new to them?!?
    Last edited by Devil Panther; 05-16-2005 at 10:37 AM.
    "I don't suffer from insanity but enjoy every minute of it" - Edgar Allen Poe

    http://www.Bloodware.net - Developing free software for the community.

  5. #35
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Hm... perhaps because the link I showed gave an example of both a client and a server? That, had they actually looked at it, they would have seen that the client did not in fact call bind. Thus, as stated, it was apparent that they didn't in fact read the what they were given.

    Like I said, why bother when people just ignore what you've been telling them has the answers?

    "Here's the answer."
    "Yeah, I only want to half-ass read that. But I want to learn. Honest!"

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

  6. #36
    * Death to Visual Basic * Devil Panther's Avatar
    Join Date
    Aug 2001
    Posts
    768
    relax dude... breath... in and out...
    "I don't suffer from insanity but enjoy every minute of it" - Edgar Allen Poe

    http://www.Bloodware.net - Developing free software for the community.

  7. #37
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Trust me, it's quite easy to be completely relaxed and still think some one is an idiot. But now we're far off track.

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

  8. #38
    Gawking at stupidity
    Join Date
    Jul 2004
    Location
    Oregon, USA
    Posts
    3,218
    Quote Originally Posted by kristy
    I guess I was trying to write a client of some kind. Do you never need to use bind when you create a client?
    FYI, section 4.3 of Beej's tutorial (talking about connect(), with sample code) states:
    Also, notice that we didn't call bind(). Basically, we don't care about our local port number; we only care where we're going (the remote port). The kernel will choose a local port for us, and the site we connect to will automatically get this information from us. No worries.
    If you understand what you're doing, you're not learning anything.

Popular pages Recent additions subscribe to a feed