winsock - how to reject connection?

This is a discussion on winsock - how to reject connection? within the Networking/Device Communication forums, part of the General Programming Boards category; hi Guys, when i have a listening socket and a connection request comes in... is there a winsock function that ...

  1. #1
    Registered User
    Join Date
    Jan 2009
    Posts
    28

    winsock - how to reject connection?

    hi Guys,

    when i have a listening socket and a connection request comes in... is there a winsock function that i can use to reject it instead of accepting it and continue listening? (after checking the remote address)

    do i have to accept it first and close the new socket?

  2. #2
    Registered User
    Join Date
    Jan 2009
    Posts
    26
    i suppose, firstly you have to accept connection and then to close it, because you get information about the client only after accept

  3. #3
    Registered User
    Join Date
    Jan 2009
    Posts
    28
    thanks baccardi

  4. #4
    Registered User
    Join Date
    Jan 2009
    Posts
    28
    i've been experimenting with the winsock libray. and i'm still new to it so bear with me.

    just an observation...
    isn't a call to listen always followed by a call accept?
    there must be a reason they are seperate functions right?

    could someone enlighten me?

    EDIT: wait, i think i get it. it's the backlog
    Last edited by symbiote; 03-13-2009 at 10:15 AM.

  5. #5
    CSharpener vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,459
    you start listening on the socket once, and then you can accept as many incoming conections on this socket as you like
    The first 90% of a project takes 90% of the time,
    the last 10% takes the other 90% of the time.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Winsock issues
    By tjpanda in forum Windows Programming
    Replies: 3
    Last Post: 12-04-2008, 07:32 AM
  2. Winsock connection problem
    By Nephiroth in forum C++ Programming
    Replies: 2
    Last Post: 02-07-2006, 06:54 AM
  3. Headers that use each other
    By nickname_changed in forum C++ Programming
    Replies: 7
    Last Post: 10-03-2003, 04:25 AM
  4. Varifying Socket Connection :: Winsock
    By kuphryn in forum Windows Programming
    Replies: 3
    Last Post: 05-11-2002, 03:26 PM
  5. Listening for connection in Winsock?
    By SyntaxBubble in forum Windows Programming
    Replies: 11
    Last Post: 11-28-2001, 11:28 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21