Networking Forums

Networking Forums > Computer Networking > Linux Networking > Any good books on "Linux Socket prog", also on "Linux Network prog"?

Reply
Thread Tools Display Modes

Any good books on "Linux Socket prog", also on "Linux Network prog"?

 
 
GS
Guest
Posts: n/a

 
      10-14-2005, 11:56 AM
Guys:

Any good books on "Linux Socket programming", also on "Linux Network
programming"?. Any valuable on-line tutorials. Appreciated.

 
Reply With Quote
 
 
 
 
Phil Frisbie, Jr.
Guest
Posts: n/a

 
      10-14-2005, 03:55 PM
GS wrote:

> Guys:
>
> Any good books on "Linux Socket programming", also on "Linux Network
> programming"?. Any valuable on-line tutorials. Appreciated.


I have never seen one, but since sockets on Linux are basically standard BSD or
Unix sockets, try searching for "Unix socket programming" or "Berkeley socket
programming".


--
Phil Frisbie, Jr.
Hawk Software
http://www.hawksoft.com
 
Reply With Quote
 
GS
Guest
Posts: n/a

 
      10-14-2005, 04:05 PM
Does "Unix socket programming" by Richard Stevens book can be used for
Linux socket programming too?.

Thanks.

 
Reply With Quote
 
GS
Guest
Posts: n/a

 
      10-14-2005, 04:06 PM
Especially looking for beginner who wants to enter into Linux
programming (Network side), looking for some books which tells basics

 
Reply With Quote
 
GS
Guest
Posts: n/a

 
      10-14-2005, 04:06 PM
Especially looking for beginner who wants to enter into Linux
programming (Network side), looking for some books which tells basics

 
Reply With Quote
 
Steve Welsh
Guest
Posts: n/a

 
      10-14-2005, 04:26 PM
GS wrote:
> Especially looking for beginner who wants to enter into Linux
> programming (Network side), looking for some books which tells basics
>


I don't want to put a dampener on your enthusiasm, but if you are
wanting to do it properly the POSIX way, I wouldn't even consider it
unless you are comfortable programming 'C' at the level of understanding
how pointers work.

You could always consider Java - piece of cake in Java!

Steve
 
Reply With Quote
 
GS
Guest
Posts: n/a

 
      10-14-2005, 09:40 PM
Is there any on-line text books available?. I did serach, but didn't
find any good ones?. Thanks.

 
Reply With Quote
 
Steve Welsh
Guest
Posts: n/a

 
      10-14-2005, 11:37 PM
GS wrote:
> Is there any on-line text books available?. I did serach, but didn't
> find any good ones?. Thanks.
>


Nope.

There are a number of really good books, and they are not cheap, but all
the POSIX sockets stuff is freely available - just download the source
code

If you are cool with this following bit of code, then you shouldn't have
a problem:

serveradd.sin_family = AF_INET;
serveradd.sin_port = htons(portnum);
memcpy(&serveradd.sin_addr,
host->h_addr_list[0],
sizeof(serveradd.sin_addr));
err = connect(mysock, (sockaddr *)
&serveradd, sizeof(serveradd));

On the other hand, if you look at this bit of code and think `WTF?',
don't even think about it!

Steve
 
Reply With Quote
 
GS
Guest
Posts: n/a

 
      10-15-2005, 12:05 AM
Steve,

Great, I understand, assign portnum and open a socket. What I couldn't
able to understand is, what is the port number I have to assign. For
example, I wanted to run server on one Linux machine and client on
another machine, both are on LAN (one is 192.168.1.2 and other one is
192.168.1.3), can I use any port number? or Is there any fixed port
number. I am little bit confuse what port number I have to use?. Also
whether I have to use STREAM or DATAGRAM kind of service?.

Thanks in advance.

 
Reply With Quote
 
Todd Knarr
Guest
Posts: n/a

 
      10-15-2005, 01:51 AM
GS <(E-Mail Removed)> wrote:
> Great, I understand, assign portnum and open a socket. What I couldn't
> able to understand is, what is the port number I have to assign. For


For a client program you typically don't assign a port. What you do is
let the system select a source address based on it's routing tables and
the host you're trying to talk to, and let it select a random
unprivileged port from the pool of available ones. Stevens covers this
in detail, it's done by using special constants for the source address
and port. The book you want is:

Unix Network Programming volume 1: Sockets and XTI
by W. Richard Stevens
published by Prentice-Hall

--
death.net: because for some problems there's only one solution.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Fwd: SPEWS DOLTS "SneakyP", "Kevin!:?)", "WindsorFox" SPAM braodbandnewsgroup] !:?) Broadband 0 11-30-2005 01:04 AM
Re: SPEWS SLIMES "WindsorFox", "Kevin-!:?)", "Spin Dryer" get the cold shoulder at broadband ng! SneakyP Broadband 0 11-29-2005 10:46 PM
Attention Plus.net Re: SPEWS DOLTS "WindsorFox", "Kevin-!:?)", "SpinDryer" SPAM broadband newsgroup !:?) Broadband 0 11-28-2005 04:28 AM
Attention Plus.Net Re: SPEWS DOLTS "WindsorFox", "Kevin-!:?)", "SpinDryer" SPAM braodband newsgroup !:?) Broadband 0 11-28-2005 03:03 AM
"hotspot" or "hot spot", "wireless" or "wi-fi" or "wi fi" ? Nic O`Neill Wireless Internet 3 02-12-2004 07:42 AM



1 2 3 4 5 6 7 8 9 10 11