By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,148 Members | 1,242 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,148 IT Pros & Developers. It's quick & easy.

C++ UDP Network Help : XPlane Simulator Program

P: n/a
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
Share this Question
Share on Google+
6 Replies


P: n/a
MSR

"Da Vinci" <dv@invent.com> wrote in message
news:tf********************************@4ax.com...
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

P: n/a
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

P: n/a
On Thu, 31 Mar 2005 19:49:05 -0500, "Victor Bazarov"
<v.********@comAcast.net> wrote:

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. 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

P: n/a
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::ReceiveFrom() which are for UDP/datagrams connectionless data transfers.

--
Ioannis Vranos

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

P: n/a
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

P: n/a
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::ReceiveFrom()
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 discussion thread is closed

Replies have been disabled for this discussion.