[RESOLVED] Kill or Disconnect Client from Server
Hey guys, i need a favor......
I want to make a program chat that can disconnect or kill the client from server................................
My Program is not different at all with cvmichael's program (thanks michael)
i click the client's nick with right click, it's show a menu to kill or disconnect the client.......
Any one can help me?? Please!!!
Thanks guys...........
Re: Kill or Disconnect Client from Server
Quote:
Originally Posted by exliko
Hey guys, i need a favor......
I want to make a program chat that can disconnect or kill the client from server................................
My Program is not different at all with
cvmichael's program (thanks michael)
i click the client's nick with right click, it's show a menu to kill or disconnect the client.......
Any one can help me?? Please!!!
Thanks guys...........
What component are you using? Winsock? For winsock just use method , to close connection from server.
Re: Kill or Disconnect Client from Server
yes, i'm using winsock..............
i've already done if client can disconnect from server...............
i mean only the server can be kill other client............ But the client can't kill other client! (Like in IRC if you have an sop or aop accsess, you can kill or ban other user)
thanks
Re: Kill or Disconnect Client from Server
You must do it via server, for example you (Client A) must msg to server '/kick CLIENTB', and server must recognize this command, and automatically kicks client B, via disconnect
Re: Kill or Disconnect Client from Server
yes i know that
but what is the code in vb?
Re: Kill or Disconnect Client from Server
You'll have to write it. ;)
What client A does is send the server a message, like "kick client B".
The server receives that message and interprets it.
This involves string manipulation and selective logic like Select Case.
The server also needs to maintain a list that stores which clint uses which socket.
Having done that, the server knows which socket connects to client B and closes that.
Re: Kill or Disconnect Client from Server
yes i know that
but what is the code in vb to kill client?
i need a code, not a logic
1 Attachment(s)
Re: Kill or Disconnect Client from Server
jeroen79, you are way off...
You shuld've looked at the link exliko provided in the first post...
Anyways...
The best person to make changes to the program is the person that made the program.... and that would be ME :D
I attached the updated Server program since that's the only one you need to make any changes.
What I did:
I added a popup menu.
I chagned the code that adds the users to the list so that it adds the socket Index to the ItemData of the list box, basically this line:
VB Code:
lstUsers.ItemData(lstUsers.NewIndex) = Index
Then in the Disconnect menu, I just call the winsock event sub, which in turn disconnects the client, and removes the user from the list:
VB Code:
Private Sub mnuDisconnect_Click()
Dim Index As Integer
If lstUsers.ListIndex <> -1 Then
Index = lstUsers.ItemData(lstUsers.ListIndex)
sckServer_Close Index
End If
End Sub
Re: Kill or Disconnect Client from Server
Thanks God, at last the program maker...................................
thanks michael (again), that's exactly what i'm looking for..........
Thanks guys, (jaroen79 and okosv)
Re: [RESOLVED] Kill or Disconnect Client from Server
You are very welcome exliko.
I found your thread by chance, just because you type my username in the post it does not mean that I get a notification that someone mentioned me in one of the threads, I wish what would be possible.
Instead, next time you want the program maker to help you, you should PM (Private Message) that person and give a link to the thread you just made, so the person knows where to go to help you (if they are willing to help you, but that's their choice...).