Network Programming -- Where do i start

Status
Not open for further replies.

H-Hour

Ars Scholae Palatinae
606
im basicly a c++ programmmer and want to try some basic(maybe it's not basic) network programming. What i want to try to do is write a program that will send/recieve a file over the net (if that is too complex for a newbie then just send it over a intranet). if that is not to hard maybe I will try to give it some weak security features --just to learn

Were should i start
I would really like to stay with c++ but should i go to a different lang?

Any good online resources?

If c++ is ok for network programing are there any good classes already written for my little project

thanks

sorry if this should be in the networking forum
 
For what platform?

Windows: try the Winsock Architecture and API's, its covered well in MSDN
Unix: learn sockets, a good Unix programming book will cover it

Also, on windows you can use Java and its java.net package which is quite a bit cleaner and simpler than either of the two alternatives above; information is on java.sun.com .

Also, you don't need to learn TCP/IP in detail.
 

Malyk

Ars Tribunus Angusticlavius
8,558
Subscriptor
I'd say go with Java to learn the basics. It's pretty easy to pick up simple java programming as the syntax is close to that of c++, and the overall ideas are similar. But the java.net library is just sooooooo much easier to use then doing the same thing in C++. At least that's been my experience. Plus you also get to learn the basics of a new language.

Mike
 

uberfunk

Seniorius Lurkius
15
A couple standard responses

1) Join comp.protocols.tcp-ip. Many good questions are answered here and it is an indispensable learning tool when learning to do network programming.

2) Absolutely, no matter what platform you are on, get yourself a copy of Unix Network Programming by Richard Stevens. It is the de facto book on network programming. It mostly covers the BSD socket interface, which is copied in some form or another by almost all network implementations (BeOS and Java being two minor exceptions.)

3) Look at other people's code and see how they do stuff. Rudiementary web servers are really easy to write. Jef Poskanzer has written a slew of them and you can grab the source for any of them at www.acme.com

4) Get a protocol analyzer. More than any other tool, this is the Swiss Army knife of figuring out what your network program is actually doing.

Good luck!
 
Pretty much all networking code is based off the TCP/IP stack in BSD, including Windows.

You're misinformed or stupid.

"All networking code"? What the hell does that mean? TCP/IP is a protocol suite, and TCP is a published standard. "All networking code" is not based on TCP/IP and certainly not on one implementation.

In fact, Windows 2000's networking code was ripped from FreeBSD.

You work for Microsoft, do you?

Windows 2000, like just about all MS products contains code written by them. The white paper describing W2K's TCP/IP implementation is here:

Windows 2000 TCP/IP Stack

You'll find its quite ingenious and well designed. Without having access to their source tree, I would say it's probably much more complex than FreeBSD's implementation.
 
RFCs are Requests For Comments that specify the interface that smtp, pop3, etc use. It also tells you the responses
that you get back, how to format messages and bunch of other stuff. In one of my programming assignments, my
group of 3 used the SMTP and POP3 RFCs to write a simple mail retrieval program.

Sorry I don't have any links, but RFCs should be easy to find.
 

pelican

Wise, Aged Ars Veteran
184
RFCs:

Requests for Comments. A good place to read abou these is:

http://www.faqs.org/rfcs/

It can be pretty dry stuff to mung through.

Also, recommend learning on a unix implementation, even if you plan on moving onto windows, as in unix you can learn how network programming originally, and will continue, to work in a native multi-user environment. <---- Please don't try to bitch-smack me for saying this, if you don't understand, oh well.

--pelican
 
Status
Not open for further replies.