[a litle OT] network programming

B

Boris Glawe

Hi,

I am going to write a client/server based application with for Linux in C++. I
am programming C++ on purpose.

There are many tutorials out there how to create a new socket, and receive and
send data.

The only thing those tutorials do not cover ist how to handle the data which
arrives over the NIC. Do I have do implement my own kind of networkprotocol
specific to my application? This would be very dangerous, as there can be many
structural failures in a protocol.

My application will be XML based - at least the data I am going to send over the
network. Are there some (open source) technolgies, which help me with this
basic task (which is sending arbitray data - in my case XML - from one machine
to another)

in addition: what do I have to take care for if I want to avoid any security
issues? The data received by my application can be anyting including malicious
machine code. How do I handle such issues ?

thanks Boris
 
D

Default User

Boris said:
Hi,

I am going to write a client/server based application with for Linux
in C++. I am programming C++ on purpose.

A *little* OT? How about completely OT? There is no way to do any of
this in ISO standard C++.


Please find a newsgroup dedicated to your platform.



Brian Rodenborn
 
B

Boris Glawe

Default said:
Boris Glawe wrote:




A *little* OT? How about completely OT? There is no way to do any of
this in ISO standard C++.

How is it possible then that there are millions of C++ programs doing a lot of
networking?
Please find a newsgroup dedicated to your platform.

I've actually posted in comp.protocols.misc and they've sent me to a c++ newsgroup.
You can avoid further traffic if you give me a hint, where to find a hint or an
answer !
 
D

Derrick Coetzee

Boris said:
How is it possible then that there are millions of C++ programs doing a
lot of networking?

Because most programs are not strictly conforming (that is, fully
portable). They rely on platform-dependent features to do things that
can't be done in standard C++. If they want to be portable to several
platforms, they create a layer of abstraction which compiles differently
on different platforms. To add these features to the standard would put
a burden on those implementing C++ compilers and libraries (and their
job is tough enough already.)
You can avoid further traffic if you give me a hint, where to find a
hint or an answer !

You're attempting to blackmail us. That's funny. Try again when you're a
bit older.
 
D

Default User

Boris said:
How is it possible then that there are millions of C++ programs doing
a lot of networking?

They use nonstandard platform extensions.


Please follow usenet courtesies by finding and reading the group FAQ,
plus reviewing at least a couple of weeks worth of messages to see what
topics are discussed.



Brian Rodenborn
 
B

Boris Glawe

You're attempting to blackmail us. That's funny. Try again when you're a
bit older.

I don't know what "blackmailing" is!
Isn't it justified to ask a question, though it's OT when you don't know where
to start with your problem? I am asking you as programmers how one usually sends
data over a network in a way that the networking process is both usefull and
secure. This is what many applications do. But I don't know where to begin. And
though the solution might be platform dependent there might be helpfull answers.

If you ask a taxi driver, where the main station is, you usually won't get the
answer "this is off topic". I usually help guys in my situation - with content
and links. And yes, I have googled before posting !
 
B

Boris Glawe

They use nonstandard platform extensions.


Please follow usenet courtesies by finding and reading the group FAQ,
plus reviewing at least a couple of weeks worth of messages to see what
topics are discussed.
Usually people don't call themself "default user" according to your usenet
courtesis.

Where can I get help?
 
D

Default User

Boris said:
Usually people don't call themself "default user" according to your
usenet courtesis.

Why? It's as good as any other handle. Should I change it to Boris
Glawe?
Where can I get help?

How would I know? It's your platform, do a bit of basic research. Use
http://groups.google.com to search on some key terms. If it happens
that you are using a UNIX system, then try comp.unix.programmer. If
Windows, then I never remember those MS group names, so I can't help
there.



Brian Rodenborn
 
D

David

Boris,

Hi,

I am going to write a client/server based application with for Linux in C++. I
am programming C++ on purpose.

Good for you. I hate it when people do it by accident.

Sorry, couldn't resist. I'm still eating breakfast. I'll ty to be more
serious now.
There are many tutorials out there how to create a new socket, and receive and
send data.

Yes, these are the basis for communications protocols with IP (including
TCP and UDP). Each OS has its own interface to the IP Stack. That is where

others worry about the C++ Standard not covering this.

You've found one or more examples so I'll go from there.
The only thing those tutorials do not cover ist how to handle the data which
arrives over the NIC. Do I have do implement my own kind of networkprotocol
specific to my application? This would be very dangerous, as there can be many
structural failures in a protocol.

You are likely not wanting to handle communications at the NIC or IP level
or any other level very low in the protocol stacks. For XML conversations
you will probably use TCP sockets. If you also want to handle such XML
communications similar to HTTP requests that puts further restrictions on
what port your server socket is tied to.

Try looking for one of the *tcp-ip forums. Several of the Unix/linux
forums may also be useful if you need more details.
My application will be XML based - at least the data I am going to send over the
network. Are there some (open source) technolgies, which help me with this
basic task (which is sending arbitray data - in my case XML - from one machine
to another)

There are tools that provide the entire package of communicatons plus XML.
Depending on your needs, you may want to write generic TCP/IP client-servers
and then pass the messages on you your XML processors. Again, this depends
on what you want to do. Simple XML over HTTP put-get conversations are
rather limited in capability (IMO) but appear to be the norm for many such
conversations. If that fits your needs, go for it. For more complicated
XML conversations, like multiple XML packets in a single direction, you
will need to handle a bit more of each protocol level.
in addition: what do I have to take care for if I want to avoid any security
issues? The data received by my application can be anyting including malicious
machine code. How do I handle such issues ?

Always validate your data and that it makes sense. Avoid common pitfalls
such as allowing buffer overruns to corrupt your data.
thanks Boris

David
 
M

Mike Smith

Boris said:
If you ask a taxi driver, where the main station is, you usually won't
get the answer "this is off topic".

But that probably is the answer you will get if you ask an auto mechanic.
 
J

John Harrison

How would I know? It's your platform, do a bit of basic research. Use
http://groups.google.com to search on some key terms. If it happens
that you are using a UNIX system, then try comp.unix.programmer. If
Windows, then I never remember those MS group names, so I can't help
there.

might be one place to start
although I'm sure there are Windows groups devoted to networking as well.

john
 
D

Default User

John said:
might be one place to start
although I'm sure there are Windows groups devoted to networking as
well.

Rereading his original message via someone else's quote, I see that he
wanted a Linux solution. Therefore, c.u.p. or a Linux newsgroup would
be a good starting point.



Brian Rodenborn
 
B

Boris Glawe

Rereading his original message via someone else's quote, I see that he
wanted a Linux solution. Therefore, c.u.p. or a Linux newsgroup would
be a good starting point.

Thanks !
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top