473,385 Members | 1,798 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Binding problem - address already in use

I have server, daemon and client (daemon and client on the same machine).
When client starts it send query to the server, server send query
to the deamon (daemon check if the client exist), daemon send a response
to the server, server send a response to the client.

First I had following numbers of udp ports:
S_PORT 2613 /* Server Port number */
S1_PORT 2614 /* Server Port for Daemon response */
C_PORT 2620 /* Client Port number */
S_APP_PORT 2624 /* application info port */
D_PORT 2619 /* Daemon Port number */

Above configuration was good on various unix systems
(IRIX, HP-UX, SunOS, SuSE) except RedHat.
bind() function put in errno EADDRINUSE - Address already in use

Then I read in RedHat info:
"If you write a server that is not one of the standard ones defined in
the database, you must choose a port number for it. Use a number
greater than `IPPORT_USERRESERVED'; such numbers are reserved for
servers and won't ever be generated automatically by the system.
Avoiding conflicts with servers being run by other users is up to you."

So I changed the ports as follow (because IPPORT_USERRESERVED == 5000):
S_PORT 5006 /* Server Port number */
S1_PORT 5002 /* Server Port for Daemon response */
C_PORT 5003 /* Client Port number */
S_APP_PORT 5004 /* application info port */
D_PORT 5007 /* Daemon Port number */

It's working on RedHat9.0 but it's not working on RedHat7.3

I know that during binding the client socket I can give 0
instead a number of port (kernel will bind the number of client port
dynamically) but during binding server socket I must specify
number of server port (client must know where will send the data to)

Is there some function in unix which reserve port for my server?
Help me please, I'am beginner in unix network programming.

Regards,
Aleksander Wodynski
Nov 13 '05 #1
2 3695
Aleksander Wodynski <no************@o2.pl> scribbled the following:
I have server, daemon and client (daemon and client on the same machine).
When client starts it send query to the server, server send query
to the deamon (daemon check if the client exist), daemon send a response
to the server, server send a response to the client.


Hold it. ISO standard C, the topic of this newsgroup, defines no
networking facilities whatsoever. Please ask in a newsgroup dedicated to
your own implementation. Thanks.

--
/-- Joona Palaste (pa*****@cc.helsinki.fi) ---------------------------\
| Kingpriest of "The Flying Lemon Tree" G++ FR FW+ M- #108 D+ ADA N+++|
| http://www.helsinki.fi/~palaste W++ B OP+ |
\----------------------------------------- Finland rules! ------------/
"I am looking for myself. Have you seen me somewhere?"
- Anon
Nov 13 '05 #2
On Wed, 01 Oct 2003 19:27:11 +0200, Aleksander Wodynski
<no************@o2.pl> wrote in comp.lang.c:
I have server, daemon and client (daemon and client on the same machine).
When client starts it send query to the server, server send query
to the deamon (daemon check if the client exist), daemon send a response
to the server, server send a response to the client.


[snip]

The C language has no built-in support for networking. It does not
support daemons, sockets, or bind(). All of these are platform
specific extensions, so this is not a language issue.

You need to ask in a group like news:comp.unix.programmer or one of
the news:comp.os.linux.development.* groups. The question is
off-topic here.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++ ftp://snurse-l.org/pub/acllc-c++/faq
Nov 13 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

21
by: Alexander N. Spitzer | last post by:
If I have a machine with 3 virtual IP addresses (192.168.1.), how can I start 3 instances of the same RMI application (each started with different properties/configs), each listening on the port...
3
by: Rodrigo Benenson | last post by:
Hi, I have a weird need in tkinter. If I have a widget I can *set* a binding ..bind("<the event>", the_callback) I also can *append* a binding ..bind("<the event>", the_second_callback,...
3
by: Dennis Chang | last post by:
Hi all, I was reading about function pointers and came across something which intrigued me. K&R2 calls qsort (pg.119) within main as so: qsort( (void **) lineptr, 0, nlines-1, (int (*) (void...
9
by: Timm | last post by:
I have an ASP.NET 2.0 page with two DropDownLists. I am using declarative data binding wherever possible and trying to minimize the use of code. The list of values in DropDownList DDL2 should be...
19
by: Larry Lard | last post by:
In the old days (VB3 era), there was a thing called the Data Control, and you could use it to databind controls on forms to datasources, and so (as the marketing speak goes), 'create database...
0
by: Steven Bolard | last post by:
Hello, I am trying to port my .net 1.1 application to 2.0. I am using vs2005. I am trying to get my webservices to run and although i can compile them and and get wsdl and service descriptions...
8
by: =?Utf-8?B?QXNo?= | last post by:
Hi, I have an object, for example User. User contains various properties which i have been able to bind to successfully using wizards and the form view. However if the class User has a property...
4
by: =?Utf-8?B?Si5NYXR0aGV3cw==?= | last post by:
Picture the cut down scenario... Say I have three datatables (Person, Address, Street) that are linked with datarelation objects using the PK/FK associations... Person -------- PersonId {PK}...
15
by: Tom Gur | last post by:
Hi, What is early/late binding ?
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.