Results 1 to 4 of 4

Thread: p2P Chat

  1. #1

    Thread Starter
    Lively Member Spider-Freak's Avatar
    Join Date
    Mar 2005
    Posts
    76

    p2P Chat

    How do I make a type of login screen. For example, I enter an ip address in a text box and I click connect. It connects to that Ip address I specified in the text box. And that person recives all messages i sent him. How can i do this?

    Thanks,
    Junior
    Last edited by Spider-Freak; Apr 24th, 2005 at 06:11 PM.

  2. #2
    Admodistrator |2eM!x's Avatar
    Join Date
    Jan 2005
    Posts
    3,900

    Re: p2P Chat

    its called winsock mate

  3. #3

    Thread Starter
    Lively Member Spider-Freak's Avatar
    Join Date
    Mar 2005
    Posts
    76

    Re: p2P Chat

    thought u guyz already knew im using Winsock =/... Um this is what i have so far:

    VB Code:
    1. 'Client Form: Where I click type Ip and click connect:
    2.  
    3. Option Explicit
    4.  
    5. Private Sub cmdConnect_Click()
    6. Winsock.Connect txtIP.Text, 42726
    7. End Sub
    8.  
    9. Private Sub Form_Load()
    10. Server.Show
    11. Server.Hide
    12. End Sub
    13.  
    14. Private Sub Winsock_Connect()
    15. MsgBox "You're Now Connected To :" & txtIP
    16. Server.Show
    17. Client.Hide
    18. txtIP.Text = ""
    19. End Sub
    20.  
    21. Private Sub Winsock_Error(ByVal Number As Integer, Description As String, _
    22.         ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, _
    23.         ByVal HelpContext As Long, CancelDisplay As Boolean)
    24. MsgBox "Error: " & Description
    25. End Sub
    26.  
    27.  
    28. 'Server Form: Where the chat is placed:
    29.  
    30. Option Explicit
    31.  
    32. Private Sub cmdSend_Click()
    33. Winsock.SendData txtChat.Text
    34. DoEvents
    35. txtMain.Text = txtMain.Text & vbNewLine & txtChat.Text
    36. txtChat = ""
    37. End Sub
    38.  
    39. Private Sub Form_Load()
    40. Winsock.LocalPort = 42726
    41. Winsock.Listen
    42. End Sub
    43.  
    44. Private Sub Winsock_ConnectionRequest(ByVal RequestID As Long)
    45. Winsock.Close
    46. Winsock.Accept RequestID
    47. End Sub
    48.  
    49. Private Sub Winsock_DataArrival(ByVal bytesTotal As Long)
    50. Dim strData As String
    51. Winsock.GetData strData
    52. txtMain = txtMain & vbNewLine & strData
    53. txtMain.SelStart = Len(txtMain.Text)
    54. End Sub

    Hope this helps more....

  4. #4

    Thread Starter
    Lively Member Spider-Freak's Avatar
    Join Date
    Mar 2005
    Posts
    76

    Re: p2P Chat

    Anyone? Also, how do you make the chatbox popup on the other person's computer when I send a message?

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