client/server compile question


 
Thread Tools Search this Thread
Top Forums Programming client/server compile question
# 1  
Old 08-17-2008
client/server compile question

Hi,
I have 2 files-->server.c and client.c
My server.c takes local ip as saying:
Code:
*.sin_addr.s_addr=INADDR_ANY;

client.c is in the same machine.It has a line like:
Code:
*.sin_addr.s_addr=inet_addr(argv[1]);

I don't know how to compile.I tried
Code:
./client 127.0.0.1

It used port 7777 in both client and server.I think i have missed something.
But it works when I use port 80.Do you know why??

I would like to post the client.c and server.c but I know if do so
people will start giving there advice.

This is a small program.It only connects the client on server.
# 2  
Old 08-17-2008
If it's working on one port and not on the other it means you're probably being blocked by a firewall or something. Is there any error when trying to create / connect the client / server in 7777 ? (if not, it's definitely a firewall).

Oh, if you try to bind a server in a low port ( < 1024 ) such as 80 you will need UID 0 (generally root).
# 3  
Old 08-18-2008
Hi

Could you please tell us what is the value set for .sin_port ? This should be the port the server is listening to... and client should also have the same port set for .sin_port as like server to get connected

Regards
Collins
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Pango 1.20 does not compile when passing Cairo or X server packages as backends

Hello. Trying to compile Pango with one or mentioned packages as backend, Cairo or X11 related packages I have been facing a series of error messages that I do not know how to fix. First with Cairo. I try to compile Pango with ./configure ... (1 Reply)
Discussion started by: colt
1 Replies

2. 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

3. Programming

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... (2 Replies)
Discussion started by: omega666
2 Replies

4. UNIX for Dummies Questions & Answers

Compiling gcc to compile make to compile yaboot

I have just installed OpenBSD on a 333MHz PPC iMac G3. It has a 6GB HDD that has been partitioned as 1GB MacOS 8.5.1, 3GB MacOS X 10.3.9, 2GB OpenBSD 4.8. I now need to install a bootloader so that my computer can recognize the OpenBSD partition at startup. I have been trying to install... (0 Replies)
Discussion started by: t04st3r
0 Replies

5. Solaris

Compile SSCEP (Simple SCEP client for Unix) on Solaris 10 box

Hi folks I am trying to compile SSCEP (Simple SCEP client for Unix) on Solaris 10 box. SSCEP - Simple SCEP client for Unix The errror is "ld: fatal: Symbol referencing errors. No output written to" $ make gcc -Wall -O -lcrypto -o sscep sscep.o init.o net.o sceputils.o pkcs7.o ias.o... (2 Replies)
Discussion started by: slashdotweenie
2 Replies

6. 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

7. Solaris

Compile php with curl on solaris 10 question

I have curl compiled into /usr/local. I needed to install another version into /usr/local/curl-7.19.5 and compile php using that directory. I believe I had done that but an ldd run against php shows it is using /usr/local/lib. I have my configure script below showing how it was built and php -i... (1 Reply)
Discussion started by: csgonan
1 Replies

8. Programming

Top v3.7 and v3.8beta1 will not compile on Power7/AIX6.1 server.

Please help! We are upgrading our server to a new Power7/AIX6.1 from Power5/AIX5.3. I have some programs that rely on output of the TOP command to do various things, however, I keep getting an error when I try to re-compile TOP on my new server (see below). I have tried TOP 3.7 (current... (1 Reply)
Discussion started by: troym72
1 Replies

9. Solaris

DBI with MySQL client library compile on Solaris

how dow you complie perl module DBI with mysql from /usr/local/mysql/bin keeps going to mysql client for /usr/sfw/bin is it the LD_PATH ???...:confused: error is # perl login.cgi DBI connect('customers;mysql_socket=/tmp/mysql.sock:localhost','root',...) failed: Client does not... (1 Reply)
Discussion started by: photon
1 Replies

10. 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
Login or Register to Ask a Question