Solved

help! UDP

Posted on 1998-07-20
2
191 Views
Last Modified: 2013-11-13
i am new at vb, using vb5. i am trying to send text from a textbox using winsock1.senddata text1.text to remotehost, my problem is i can send the data, i can see the modem icon blink, but the host i am sending to cant get to it, i use winsock1.getdata Text, byval to retrieve the data ( i read this all from the VB helpfiles), only if the host send me data after i have send it data then we can send text back and forth, seems like there most be somesort of handshaking before we can send and retrieve data, is there anyway around this? where it does not need the host to reply?  meaning i want to be able to just send data then it will place it in a textbox. thanks
0
Comment
Question by:sunsun
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 

Author Comment

by:sunsun
ID: 1466216
Edited text of question
0
 

Accepted Solution

by:
DanJenkins earned 50 total points
ID: 1466217
For UDP there is no handshaking required.  If App1 send to App2 the message should be proccesed and displayed, NO acknowledgement is required from App2.

Add the Winsock Control to your Form.
On the property page for the Winsock Control set the following:
Change the Protocol to: sckUDPProtocol

The name will default to Winsock1.

Private Sub Form_Load()
  Winsock1.RemoteHost = "Name of far-end computer"
  Winsock1.RemotePort = 'any integer above 1000
  Winsock1.Bind XXXX 'any integer above 1000 but different from
                     'the RemotePort value.
End Sub

Private Sub Text1_Change()
  Winsock1.SendData Text1.Text
End Sub

Private Sub Winsock1_DataArrival(ByVal bytesTotla as Long)
  Dim sText as String
  Winsock1.GetData sText
  Text1.Text = sText
End Sub

This does work & does not require any acknowledgements.

0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Re-position sub-options beneath the TAB 7 107
Prevent user closing word document opened with VB6 6 84
Child Form in front 4 56
MsgBox 4 71
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question