Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Sending Winsock UDP packet problem

Posted on 2003-11-04
9
Medium Priority
?
692 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
9 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

636 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