VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Make a simple UDP chatting program

by Bj?rn Wehlin (1 Submission)
Category: Internet/HTML
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Wed 26th June 2002
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Make a simple UDP chatting program

Rate Make a simple UDP chatting program



'Create a winsock control name it to sckMain and change the protocol to UDP protocol
'Create 5 textboxes name them in order: txtRHost, txtRPort, txtLPort, txtOut, txtIn | in txtOut set the Locked property to True
'Create 2 commandbuttons name them in order: cmdSend, cmdConnect

Private Sub cmdConnect_click()
sckMain.RemoteHost = txtRHost 'In this textbox it shall eigther be an IP address or a freindly computer name i.e. PC1 to the computer you´re about to connect to.
sckMain.RemotePort = txtRPort 'Here shall a remote port be filled in thats the port to the computer you´re about to connect to
sckMain.Bind txtLPort 'The port you are using, the other user uses this port for remote port
End Sub

Private Sub cmdSend_click()
'Send the data thats in txtIn to the other user if it´s not empty
If txtIn <> "" Then
sckMain.SendData txtIn.text
End If
End Sub

Private Sub sckMain_Dataarrival(ByVal bytesTotal As Long)
'Shows the message from the other user in txtOut and makes a beep sound so the other user knows that he/she got a message
sckMain.GetData txtOut
Beep
End Sub



Download this snippet    Add to My Saved Code

Make a simple UDP chatting program Comments

No comments have been posted about Make a simple UDP chatting program. Why not be the first to post a comment about Make a simple UDP chatting program.

Post your comment

Subject:
Message:
0/1000 characters