Solved

help! UDP

Posted on 1998-07-20
2
186 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
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
There is an easy way, in .NET, to centralize the treatment of all unexpected errors. First of all, instead of launching the application directly in a Form, you need first to write a Sub called Main, in a module. Then, set the Startup Object to th…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

746 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now