Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Sending Winsock UDP packet problem

Posted on 2003-11-04
9
Medium Priority
?
694 Views
Last Modified: 2013-12-26
Hi, I'm ted

I got this little dilemma that I was hoping you could help me with.  I am writing a visual basic app that uses a Winsock control to send a UDP packet to my server containing a string "status".  This then provokes a response telling me the server information needed. The problem I have is that it will only send the response back to the workstation that sent the packet. I want to be able to manipulate the UDP packet with the source address of say my other box so that another box on my network gets the response. In short I want a program where i can send status from a workstation, and have the response sent to my other workstations. Sending UDP packets with different source addresses and i am not sure how to go about coding this, the UDP packet itself works perfectly.

Sorry if this is a bit long winded, I found it hard to explain.

Any help would be most appreciated , especially code

Kind regards

Ted
0
Comment
Question by:tedcrowley
  • 3
  • 2
6 Comments
 
LVL 9

Accepted Solution

by:
Dang123 earned 260 total points
ID: 9686576
On the server, is it a program you wrote that is responding to your UDP packet or the Windows system itself.

If it is a program you wrote, you could have it send out the information in a broadcast instead of just to the originator. If it is code outside your control you could have you program listen for the response after sending the UDP packet and broadcast the information itself, sort of like a relay (you would probably want to include the name of the server in the broadcast incase you apply this to more than one in the future).

Here is a link that would help you with sending the broadcast

http://abstractvb.com/code/code685.asp
0
 

Author Comment

by:tedcrowley
ID: 9686824
Hi dang I'm Ted,

Thanks for the prompt reply, I neglected to tell you that it is a piece of software that is being sent the status packet and i have no control over this commercial program.  I was hoping that it would be possible to assign a different source address (IP address) than the computer I am sending the UDP packet from so that another computer on my network receives the status response (packet reply).

In all honesty I would rather not adhere the broadcast methodology because the packet will be received by many workstations. Consuming our much needed bandwidth.
0
 
LVL 9

Expert Comment

by:Dang123
ID: 9686940
Ted,
    The address is placed by TCP/IP, I don't think you can change it without getting into the low level workings of the protocol. You could let your program receive the response and relay it to the other machine(s).

Dang123

0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:tedcrowley
ID: 9687302
Hey dang so I guess it's impossible to create the underlying of the UDP packet in VB, as you can in say C? When you build the UDP and IP header of the packet?
0
 
LVL 5

Assisted Solution

by:dc197
dc197 earned 260 total points
ID: 9724035
No, not impossible.
But the beauty of MSwinsck.ocx is that it takes care of it all for you.

If you need low level IP packet manipulation, the winsock control is not for you.
0
 
LVL 9

Expert Comment

by:Dang123
ID: 10431876
Sudgest split between Dang123 and dc197
0

Featured Post

Technology Partners: 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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

571 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