473,563 Members | 2,695 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

C++ UDP Network Help : XPlane Simulator Program

Hello,

I am starting a project that requires data transfer via UDP. It will
be between two different computers. I have all of the information that
needs to be sent in the packet and what the return packets are. What I
do not know is how to open a UDP connection in C++ and structure the
packet to send.

This is for a home built simulator running the X-Plane software. The
sim will be on one computer and is configurable to send data out to a
specified IP address and also to bring in data sent to it. The program
I need to make will be on the other computer that has all the hardware
attached to it. I already have the hardware figured out and have a
program to control all the I/O to it.

If anyone out there could suggest a book on the subject, point me to
some commented source code, post examples of source code, or anything
else, I would be much appreciative. My C++ is a little rusty and not
to advanced. I can do all of the loops, arrays, pointers, and class
stuff but that is about it.

Many Thanks in Advance.
Jul 23 '05 #1
6 6970
MSR

"Da Vinci" <dv@invent.co m> wrote in message
news:tf******** *************** *********@4ax.c om...
Hello,

I am starting a project that requires data transfer via UDP. It will
be between two different computers. I have all of the information that
needs to be sent in the packet and what the return packets are. What I
do not know is how to open a UDP connection in C++ and structure the
packet to send.

This is for a home built simulator running the X-Plane software. The
sim will be on one computer and is configurable to send data out to a
specified IP address and also to bring in data sent to it. The program
I need to make will be on the other computer that has all the hardware
attached to it. I already have the hardware figured out and have a
program to control all the I/O to it.

If anyone out there could suggest a book on the subject, point me to
some commented source code, post examples of source code, or anything
else, I would be much appreciative. My C++ is a little rusty and not
to advanced. I can do all of the loops, arrays, pointers, and class
stuff but that is about it.

Many Thanks in Advance.


You could try reading Richard Steven's Unix Network Programming to
understand the concepts. If you want to a quick route and need c++ sockets
libray take a look at http://www.alhem.net/Sockets/.
Jul 23 '05 #2
Da Vinci wrote:
I am starting a project that requires data transfer via UDP. It will
be between two different computers. I have all of the information that
needs to be sent in the packet and what the return packets are. What I
do not know is how to open a UDP connection in C++ and structure the
packet to send.
Unfortunately, Standard C++ language, the topic of this newsgroup, does
not have any facilities to help you with that. You need to ask your
OS-specific question in a newsgroup for your OS.
[...]

If anyone out there could suggest a book on the subject, point me to
some commented source code, post examples of source code, or anything
else, I would be much appreciative. My C++ is a little rusty and not
to advanced. I can do all of the loops, arrays, pointers, and class
stuff but that is about it.


I am fairly certain that network programming has been discussed in the
newsgroup for your OS and is probably part of any programming book that
deals with your OS. You could start by searching the archives (go to
http://groups.google.com) for any discussions on programming networks
in your OS.

V
Jul 23 '05 #3
On Thu, 31 Mar 2005 19:49:05 -0500, "Victor Bazarov"
<v.********@com Acast.net> wrote:

Unfortunatel y, Standard C++ language, the topic of this newsgroup, does
not have any facilities to help you with that. You need to ask your
OS-specific question in a newsgroup for your OS. I am fairly certain that network programming has been discussed in the
newsgroup for your OS and is probably part of any programming book that
deals with your OS. You could start by searching the archives (go to
http://groups.google.com) for any discussions on programming networks
in your OS.

V

Shows how little I know of the scope of C++. I was under the
assumption networking was a part of the language, not spefic to OS.

Thanks.
Jul 23 '05 #4
Da Vinci wrote:
Hello,

I am starting a project that requires data transfer via UDP. It will
be between two different computers. I have all of the information that
needs to be sent in the packet and what the return packets are. What I
do not know is how to open a UDP connection in C++ and structure the
packet to send.

This is for a home built simulator running the X-Plane software. The
sim will be on one computer and is configurable to send data out to a
specified IP address and also to bring in data sent to it. The program
I need to make will be on the other computer that has all the hardware
attached to it. I already have the hardware figured out and have a
program to control all the I/O to it.

If anyone out there could suggest a book on the subject, point me to
some commented source code, post examples of source code, or anything
else, I would be much appreciative. My C++ is a little rusty and not
to advanced. I can do all of the loops, arrays, pointers, and class
stuff but that is about it.

You will have to use some OS library. In fact these days I am learning .NET networking.
Unfortunately UDP/datagrams is in later pages than what I have read so far, but I can tell
you that if you are using .NET, you will use the member functions Socket::SendTo( ) and
Socket::Receive From() which are for UDP/datagrams connectionless data transfers.

--
Ioannis Vranos

http://www23.brinkster.com/noicys
Jul 23 '05 #5
Da Vinci wrote:
Shows how little I know of the scope of C++. I was under the
assumption networking was a part of the language, not spefic to OS.

A nice book for ISO C++:

http://www.acceleratedcpp.com

--
Ioannis Vranos

http://www23.brinkster.com/noicys
Jul 23 '05 #6
Ioannis Vranos wrote:
You will have to use some OS library. In fact these days I am learning
.NET networking. Unfortunately UDP/datagrams is in later pages than what
I have read so far, but I can tell you that if you are using .NET, you
will use the member functions Socket::SendTo( ) and Socket::Receive From()
which are for UDP/datagrams connectionless data transfers.

Also keep in mind that networking involves multithreading, if you do not want the program
interface freezing while sending or receiving data, or not being able to send or receive
any data while processing the previous data.

--
Ioannis Vranos

http://www23.brinkster.com/noicys
Jul 23 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2293
by: Alex Vinokur | last post by:
C++ Simulator of a Universal Turing Machine can be downloaded at : * http://alexvn.freeservers.com/s1/utm.html * http://sourceforge.net/projects/turing-machine/ The program simulates a Universal Turing Machine (UTM). The UTM used in the Simulator is three-tape Turing Machine: * Tape#0 contains transition table and initial instantaneous...
9
2621
by: Milk | last post by:
Hi all, Can anyone help me to do this Question. Coz this is my first time study C++ language and my lecture want me to do this kind of program, i really don't have any ideal pls help me here is the Question:: Improve the following (badly written) matrix multiplicationprogram and translate it into MIPs assembly language then assemble into...
3
5059
by: Yan ZHANG | last post by:
1. In a network, there are a number of nodes. Each node has a queue and a thread, performing the discrete event simulation. class CNode {... queue q; CWinThread* pthread; void Start();//to execute the thread .... }; where CWinThread is the thread class in MFC.
61
16206
by: /* frank */ | last post by:
I have to do a homework: make a CPU simulator using C language. I have a set of asm instructions so I have to write a program that should: - load .asm file - view .asm file - do a step by step simulation - display registers contents I tried to search con google with no success.
1
1901
by: Daniel | last post by:
Hi, I was wondering if anybody can give me pointers on an existing network simulator in Python somthing like ns2 which would model all the real world internet dynamics including TCP stacks, congestion, flow control etc. Every help is appreciated, Thanks
3
4728
by: DanielJohnson | last post by:
I was wondering if anyblody can suggest me a network simulator written in python in which I can add on my own code and extend its functionality. I am looking for a simulator which will simualte TCP, UDP, RTP and most networking protocol. The learning curve for ns2 and other simulator is too high for me at this time and thats why I am...
18
5685
by: activearun.83 | last post by:
Hi everyone, Can anyone give some idea about developing an 8085 simulator program in C? What techniques can be handled to develop this?
0
1876
by: devidevi | last post by:
hi i want to know how to perform Routing in mobile adhoc network using AODV protocol in NS2 simulator & to find out packet delivery ratio...plz help me out
0
1052
by: blaine | last post by:
Hey everyone, I was hoping to see some people out on the python list that are familiar with MDP (Modular Toolkit for Data Processing - http://mdp-toolkit.sourceforge.net/)? I am wanting to develop a very simple feed forward network. This network would consist of a few input neurons, some hidden neurons, and a few output neurons. There is...
0
7583
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7885
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7638
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7948
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6250
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5484
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3642
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2082
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.