Solved

help! UDP

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Macro: print each sheet to pdf using ExportAsFixedFormat 11 48
Protecting vb6 & .Net code Obfuscation 18 121
Work with App store 7 51
Python 3.5.2 32 virtualenv problems 3 34
If you haven’t already, I encourage you to read the first article (http://www.experts-exchange.com/articles/18680/An-Introduction-to-R-Programming-and-R-Studio.html) in my series to gain a basic foundation of R and R Studio.  You will also find the …
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

785 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