question about server client code in C


 
Thread Tools Search this Thread
Top Forums Programming question about server client code in C
# 1  
Old 03-29-2011
question about server client code in C

If I have two files server.c and client.c, how do you demonstate the client reading something from the server?
so say i have a server,c and a client.c file in a unix machine (same folder), and i want the client to connect and write something to server (through the internet), then server returns it back (and changes something), and client prints it to stdout.

Does that mean that only the client.c has to be compiled and run? Or how would one compile it?
# 2  
Old 03-30-2011
The client has to connect to something, if the server isn't running the client will get connection refused.
# 3  
Old 03-30-2011
You would compile client.c on the client machine and server.c on the server (or at least run it there)
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Sftp script for dev server to client server

hi, i am new to unix, cuold u send some sftp acripts to send files to dev server to clint server, (1 Reply)
Discussion started by: Koti.annam
1 Replies

2. UNIX for Dummies Questions & Answers

Client server C

Hello, Please, is there on unix.com the source code of a client C and server C: as shown in following figure: File:InternetSocketBasicDiagram zhtw.png - Wikipedia, the free encyclopedia Thank you so much for help (1 Reply)
Discussion started by: chercheur857
1 Replies

3. Programming

Client Server C

Hello, Please I would create a client and a server in C that communicate frequently. The client sends "hello message" to the server, the server waits a few minutes and sends a "hello message" to the client, the client sends again "hello server ".. etc up to 15 minutes Can you guide me... (3 Replies)
Discussion started by: chercheur857
3 Replies

4. Windows & DOS: Issues & Discussions

Office server => laptop =>client server ...a lengthy and laborious ftp procedure

Hi All, I need your expertise in finding a way to solve my problem.Please excuse if this is not the right forum to ask this question and guide me to the correct forum,if possible. I am a DBA and on a daily basis i have to ftp huge dump files from my company server to my laptop and then... (3 Replies)
Discussion started by: kunwar
3 Replies

5. Programming

Client/Server Socket Application - Preventing Client from quitting on server crash

Problem - Linux Client/Server Socket Application: Preventing Client from quitting on server crash Hi, I am writing a Linux socket Server and Client using TCP protocol on Ubuntu 9.04 x64. I am having problem trying to implement a scenario where the client should keep running even when the... (2 Replies)
Discussion started by: varun.nagpaal
2 Replies

6. Shell Programming and Scripting

Client-server

Hi, I have installed the vmware server on my debian os and has several clients connected to it. Is there any script that enable the server to restart the client automatically?? Can anyone help. Thanks in advance (3 Replies)
Discussion started by: kanexxx
3 Replies

7. UNIX for Advanced & Expert Users

DHCP client question

hi all, In dhcp client , how to specify no of retiral attempts for getting IP ? man dhclient.conf - has rery timeout but i m looking for attempts Also option nwip.autoretries uint8; - i guess this is for dhcpd server I basically want to expire after the first attempt. Any... (1 Reply)
Discussion started by: ramchan10
1 Replies

8. Programming

client/server compile question

Hi, I have 2 files-->server.c and client.c My server.c takes local ip as saying: *.sin_addr.s_addr=INADDR_ANY; client.c is in the same machine.It has a line like: *.sin_addr.s_addr=inet_addr(argv); I don't know how to compile.I tried ./client 127.0.0.1 It used port 7777 in both client... (2 Replies)
Discussion started by: mlhazan
2 Replies

9. UNIX for Dummies Questions & Answers

Question: NFSSTAT from CLIENT

Hi This is my post and I post here looking for solution to the problem that I am facing. I recently started working on NFS.... so here it goes. I have a client-server model with IP between them. Since there are multiple clients that accesss the same server and there is no communication... (1 Reply)
Discussion started by: xxxyyyy
1 Replies

10. Programming

multiuser chat server closes when one client closes. code included

I have been trying to write a very basic chat program but at the moment I am having problems getting it to be multiuser as it closes all connections when one client shutsdown. I have also been having problems trying to get the program to display a list of usernames to the clients. I have tried... (0 Replies)
Discussion started by: dooker
0 Replies
Login or Register to Ask a Question