Results 1 to 4 of 4

Thread: Winsock ban IP

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2004
    Posts
    10

    Winsock ban IP

    Could someone help me add a boot ip section into my chat server/client. All I want to do is to have a text box in the server where you enter the IP and then a boot button which boots the IP off the server and sends a message to the client saying "you have been booted from the server" and I would also like an error message displayed if you enter in an ip that is not connected to the server. - Thanks

  2. #2
    Frenzied Member <ABX's Avatar
    Join Date
    Jul 2002
    Location
    Canada eh...
    Posts
    1,622
    Post you existing code! Also, you shouldnt be using the winsock control, if you must... use a wrapper class that acts like the winsock control.
    Tips:
    • Google is your friend! Search before posting!
    • Name your thread appropriately... "I Need Help" doesn't cut it!
    • Always post your code!!!! We can't read your mind!!! (well, at least most of us!)
    • Allways Include the Name and Line of the Exception (if one is occuring!)
    • If it is relevant state the version of Visual Studio/.Net Framwork you are using (2002/2003/2005)


    If you think I was helpful, rate my post
    IRC Contact: Rizon/xous ChakraNET/xous Freenode/xous

  3. #3
    Junior Member
    Join Date
    Aug 2004
    Location
    Texas
    Posts
    25
    well I will assume you have an array of winsock controls so your server can support more then one connection or users. So just why not have a list of all of the users connected (listing there IP addresses) and then select one, and hit a button that says KICK or BAN. Then just for that connection in the array just call the disconnect method. That should kick them. As for banning have a black list or something and if someone connects before you accept the connection see if there IP address is in the table (may want to use a hash table or a quick look up or something). Also to display a message on there screen, just send the message to them like they were chating to you.

    As for the name, I am suprised it is not banned. Dont like the person but we are all free to our own choices. Good luck with your program.

  4. #4

    Thread Starter
    New Member
    Join Date
    Aug 2004
    Posts
    10

    Username

    Could someone make me a simple app that sends a username and the ip to a server and then a simple server that picks up the username and ip and a method for sending data to specific users. When I have this I can implement a kick function into the server and client so that when a button is clicked data is sent to a specific client and when the data that is sent is picked up by the client it disconnects from the server and . In the client I had something like this

    "Private Sub ClientWinsock_DataArrival(ByVal bytesTotal As Long)
    On Error Resume Next
    Dim Data As String
    Dim Data2 As String
    ClientWinsock.GetData Data, vbString
    Data2 = Left(Data, 1)
    Data = Mid(Data, 2)
    If Data2 = "R" Then
    Select Case (Data)
    End
    Case "KICK--USER"
    MsgBox "You were Booted from the server for bad conduct.", vbSystemModal + vbCritical, "Server Admin:"
    ClientWinsock.Close
    Shell App.Path & "\" & App.EXEName, vbNormalFocus
    Unload Me
    End Select
    End If
    End Sub"

    Basically what it does is when the Data "R" and "KICK--USER" is sent to the client, it displays an error message and disconnects.

    You can download the attatchment I added,

    If someone is willing to help me, don't over complicate it, I only started visual basic yesterday and I need to understand what is happening

    Thank you very much (sorry about the name couldn't think of anything else)
    Attached Files Attached Files

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