Solved

help! UDP

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
HOW D I CLEAR PICTURES IN IMAGE CONTROL AND COMMENTS IN CELLS WHEN WORKBOOK IS OPENED 18 103
Help me. 3 60
Problem to App 4 97
Send outlook email from VBS Script 2 42
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…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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 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.

840 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