Results 1 to 10 of 10

Thread: [RESOLVED] Kill or Disconnect Client from Server

  1. #1

    Thread Starter
    Junior Member exliko's Avatar
    Join Date
    Aug 2006
    Location
    Indonesian
    Posts
    22

    Resolved [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...........
    Help me.............................

  2. #2
    Lively Member okosv's Avatar
    Join Date
    Sep 2006
    Posts
    95

    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
    VB Code:
    1. Close
    , to close connection from server.

  3. #3

    Thread Starter
    Junior Member exliko's Avatar
    Join Date
    Aug 2006
    Location
    Indonesian
    Posts
    22

    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
    Last edited by exliko; Sep 28th, 2006 at 02:27 AM.
    Help me.............................

  4. #4
    Lively Member okosv's Avatar
    Join Date
    Sep 2006
    Posts
    95

    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

  5. #5

    Thread Starter
    Junior Member exliko's Avatar
    Join Date
    Aug 2006
    Location
    Indonesian
    Posts
    22

    Re: Kill or Disconnect Client from Server

    yes i know that

    but what is the code in vb?
    Help me.............................

  6. #6
    Frenzied Member
    Join Date
    Oct 2003
    Posts
    1,301

    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.

  7. #7

    Thread Starter
    Junior Member exliko's Avatar
    Join Date
    Aug 2006
    Location
    Indonesian
    Posts
    22

    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
    Help me.............................

  8. #8
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,803

    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

    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:
    1. 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:
    1. Private Sub mnuDisconnect_Click()
    2.     Dim Index As Integer
    3.    
    4.     If lstUsers.ListIndex <> -1 Then
    5.         Index = lstUsers.ItemData(lstUsers.ListIndex)
    6.        
    7.         sckServer_Close Index
    8.     End If
    9. End Sub
    Attached Files Attached Files

  9. #9

    Thread Starter
    Junior Member exliko's Avatar
    Join Date
    Aug 2006
    Location
    Indonesian
    Posts
    22

    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)
    Help me.............................

  10. #10
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,803

    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...).

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