Results 1 to 4 of 4

Thread: How To Reject A Connection Request?

  1. #1

    Thread Starter
    Member
    Join Date
    Jun 2005
    Posts
    35

    Resolved How To Reject A Connection Request?

    i'm using winsock control with mt project "Auto TImer For Cafe's", The basis for connection for the server from a any client is FCFS, i used a variable "Busy as Boolean" wherein i set to true if the server is busy or connected to one client, and false if finished getting data from clilent and disconnected (after finished), but the prob is, even i filter any connection from other client:

    e.g.
    VB Code:
    1. Private Sub Link_ConnectionRequest(Index As Integer, ByVal requestID As Long)
    2. If Not Busy Then
    3.     Busy = True
    4.     Load Link(1)
    5.     Link(1).Accept requestID
    6. End If
    7. End Sub

    still the connection state of the other client set's to sckConnected or 7, what probably the reason, or is there any other technique to filter undesirable connection request??? please help....
    any comment or help will gladly appreciate!..

    Thankx....
    Last edited by Apollyon255; Jun 21st, 2005 at 12:03 PM. Reason: Resolved

  2. #2
    PowerPoster
    Join Date
    Dec 2003
    Posts
    4,787

    Re: How To Reject A Connection Request?

    Try this,

    VB Code:
    1. If Busy Then
    2.     Link(1).Close
    3. Else
    4.     Busy = True
    5.     Load Link(1)
    6.     Link(1).Accept requestID
    7. End If

  3. #3

    Thread Starter
    Member
    Join Date
    Jun 2005
    Posts
    35

    Re: How To Reject A Connection Request?

    Thankz for reply pino...

    I already resolved my problem since yestrday...

    but i guess your suggestion may result to a winsock error in my program... because "busy" state in my program means that i have the a current client that i am entertaining with and i am not yet finished with that transaction.. so if i disconnect link(1), i am no longer connected to my current client and can't be able to send and recieve any signal from it...

    The solution i found is to close the main link w/c is the link(0), w/c is the link that listening to all socket in the network, therefore, if a listening port or socket is in sckclosed state, it won't recieve or entertain any connection request...

    I appreciate ur effort... really appreciated...

    BuB'

  4. #4
    PowerPoster
    Join Date
    Dec 2003
    Posts
    4,787

    Re: How To Reject A Connection Request?

    No probs glad you sorted it anyhows

    Pino

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width