Solved

Sending Winsock UDP packet problem

Posted on 2003-11-04
9
674 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
9 Comments
 
LVL 9

Accepted Solution

by:
Dang123 earned 65 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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
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.

 

Author Comment

by:tedcrowley
Comment Utility
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 65 total points
Comment Utility
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
Comment Utility
Sudgest split between Dang123 and dc197
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

763 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

6 Experts available now in Live!

Get 1:1 Help Now