|
-
Jun 20th, 2005, 09:48 AM
#1
Thread Starter
Member
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:
Private Sub Link_ConnectionRequest(Index As Integer, ByVal requestID As Long)
If Not Busy Then
Busy = True
Load Link(1)
Link(1).Accept requestID
End If
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
-
Jun 20th, 2005, 11:20 AM
#2
Re: How To Reject A Connection Request?
Try this,
VB Code:
If Busy Then
Link(1).Close
Else
Busy = True
Load Link(1)
Link(1).Accept requestID
End If
-
Jun 21st, 2005, 12:01 PM
#3
Thread Starter
Member
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'
-
Jun 21st, 2005, 12:28 PM
#4
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|