LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 09-15-2008, 07:08 AM   #1
rahb20
LQ Newbie
 
Registered: Sep 2008
Posts: 6

Rep: Reputation: 0
running socket programming (client/server) on single computer


hello everybody ...

i have installed the red hat linux ... for socket programming purpose in c.
unfortunately i have single computer, so please any one tell me how to run client/server programs on single computer.

i have created both the client and server programs.
thanks
 
Old 09-15-2008, 07:27 AM   #2
pinniped
Senior Member
 
Registered: May 2008
Location: planet earth
Distribution: Debian
Posts: 1,732

Rep: Reputation: 50
You simply run them on that computer; you can always configure the sockets so that they listen on the 'loopback' interface (127.0.0.1) - you can do that by specifying 127.0.0.1 explicitly or by setting the socket to listen on all interfaces (0.0.0.0).

It is common for client/server programs to run on a single machine - like the X server and client, database servers, http servers ... so it's a very normal thing to do.
 
Old 09-16-2008, 04:53 AM   #3
prasad_ark
LQ Newbie
 
Registered: Jul 2008
Posts: 18
Blog Entries: 1

Rep: Reputation: 0
1.Open a shell. Run server
2.Open another shell run client.connect to 127.0.0.1.Give the port number either as an argument or in the program.
 
Old 09-16-2008, 04:55 AM   #4
prasad_ark
LQ Newbie
 
Registered: Jul 2008
Posts: 18
Blog Entries: 1

Rep: Reputation: 0
1.Open a shell. Run server
2.Open another shell run client.connect to 127.0.0.1.Give the port number either as an argument or in the program.

Make sure you run the server program first and only then client could run.

Thanks
 
Old 09-16-2008, 02:00 PM   #5
rahb20
LQ Newbie
 
Registered: Sep 2008
Posts: 6

Original Poster
Rep: Reputation: 0
thanks dudes ... actually i am new to linux and socket programming, so thats y
my problem was solved, infact i have only to give the ip address (loopback) after the client and server programs.

can any body recomend me a good website/tutorial or book about socket programming from absolutely beginning.

i am studying beej guide, take the concept how server and client communicate with each other but didnt understand the code.
 
Old 09-16-2008, 11:09 PM   #6
prasad_ark
LQ Newbie
 
Registered: Jul 2008
Posts: 18
Blog Entries: 1

Rep: Reputation: 0
See 'Beginning Linux Programing' by Wrox publishers.I think their url is www.wrox.com.The book is not about socket programming,but has a chapter on socket programming with detailed explanation of code.You can buy the book or download the code from their site.search for 'Beginning Linux Programming'.They have a 'Beginning' series of books.

Thanks.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Synchronization problem wait forever when multiple client socket programming Ashok_mittal Programming 1 06-02-2008 06:23 AM
cannot read data at server socket, though client socket sends it jacques83 Linux - Networking 0 11-15-2005 01:58 PM
how to implement fork() in socket programming b/w server/client in voice communicatio timeout4me Programming 1 08-05-2005 04:01 PM
socket server programming for help! edwardhayes Programming 7 09-27-2003 05:33 AM
C++ Server side socket programming Mr_ss Programming 1 05-11-2001 05:11 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 02:49 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration