- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: How can i make an inetd process?
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-30-2006 06:40 PM
тАО05-30-2006 06:40 PM
How can i make an inetd process?
I have a client an server among which i want to make the server an inetd process.
I have enries in etc/services and etc/inetd.conf
The enries looks like below
etc/services
servername 5551/tcp
etc/inetd.conf
servername stream tcp nowait root /binu
Now if I try to run my client ,the connection with server is not getting established
My client code to connect ins ome thng like this
sd = socket (AF_INET, SOCK_STREAM, 0); CHK_ERR(sd, "socket");
memset (&sa, '\0', sizeof(sa));
sa.sin_family = AF_INET;
sa.sin_addr.s_addr = inet_addr ("127.0.0.1"); /* Server IP */
sa.sin_addr.s_addr = inet_addr ("164.164.27.88");
sa.sin_port = htons (5551); /* Server Port number */
err = connect(sd, (struct sockaddr*) &sa,
sizeof(sa)); CHK_ERR(err, "connect");
/* ----------------------------------------------- */
/* Now we have TCP conncetion. Start SSL negotiation. */
ssl = SSL_new (ctx); CHK_NULL(ssl);
SSL_set_fd (ssl, sd);
err = SSL_connect (ssl); CHK_SSL(err);
and my server code is like below
/* Prepare TCP socket for receiving connections */
listen_sd = socket (AF_INET, SOCK_STREAM, 0); CHK_ERR(listen_sd, "socket");
memset (&sa_serv, '\0', sizeof(sa_serv));
sa_serv.sin_family = AF_INET;
sa_serv.sin_addr.s_addr = INADDR_ANY;
sa_serv.sin_port = htons (5551); /* Server Port number */
err = bind(listen_sd, (struct sockaddr*) &sa_serv,
sizeof (sa_serv)); CHK_ERR(err, "bind");
/* Receive a TCP connection. */
err = listen (listen_sd, 5); CHK_ERR(err, "listen");
client_len = sizeof(sa_cli);
//Binu
sd = accept (listen_sd, (struct sockaddr*) &sa_cli,(int *) &client_len);
CHK_ERR(sd, "accept");
close (listen_sd);
can any one please help me?
Thanks
Binu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-30-2006 10:13 PM
тАО05-30-2006 10:13 PM
Re: How can i make an inetd process?
Did you force inetd to reload the config file by inetd -c ?
And in your inetd.conf, you must have the complete path to your server and the command to execute your server itself... kind of
servername stream tcp nowait root /binu binu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-30-2006 10:15 PM
тАО05-30-2006 10:15 PM
Re: How can i make an inetd process?
I have given all entries.
Actually now I have noticed that the connection is establishing, but the bind in the server is failing
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-31-2006 11:25 PM
тАО05-31-2006 11:25 PM
Re: How can i make an inetd process?
I don't remember well but as it's inetd which is managing the socket connection, I'm not sure you've to do a 'bind' in your server... There's also a faq you can check at http://www.manualy.sk/sock-faq/unix-socket-faq-4.html
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-01-2006 02:38 AM
тАО06-01-2006 02:38 AM
Re: How can i make an inetd process?
Actually i have removed the bind calls as it is not required .Now the problem is that, I m not sure to which sd i have to do a read and write .
( I m using SSL server.Hence i m using SSL_read ,SSL_write etc )
Binu