- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- connect error in socket programming
Operating System - HP-UX
1752794
Members
7007
Online
108789
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Discussions
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- 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
03-26-2008 08:01 AM
03-26-2008 08:01 AM
connect error in socket programming
Hi frns,
I have written a socket programming in C to interact with java. I do act as a client and java acts as a server & java is getting invoked from my C code.
When i connect it is a non blocking call and it returns -1(Connection refused). Could you please suggest some soln for this.
I would like to add one more thing... I need to recall my connect in client repetedly untill the server is up and do accept my connect.
Note: we tried sleep before the connect and while but ended up in vain.
I have written a socket programming in C to interact with java. I do act as a client and java acts as a server & java is getting invoked from my C code.
When i connect it is a non blocking call and it returns -1(Connection refused). Could you please suggest some soln for this.
I would like to add one more thing... I need to recall my connect in client repetedly untill the server is up and do accept my connect.
Note: we tried sleep before the connect and while but ended up in vain.
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2008 08:14 AM
03-26-2008 08:14 AM
Re: connect error in socket programming
"Connection refused" normally means that
you've reached the other system, but that
there's no program listening at the port
you've specified.
Which port are you expecting to use?
Does "telnet server_host that_port" work, or
do you get "connection refused"?
What makes you believe that your server is
running and listening at the port you're
trying to use?
> I need to recall my connect in client
> repetedly untill the server is up and do
> accept my connect.
So, what's stopping you from doing that?
(Of course, you can burn a lot of CPU and
network resources by retrying this in a
wait-less loop. Also, if no one is listening
at the other end, retrying is not likely to
change much.)
> [...] but ended up in vain.
What does that mean? Symptom descriptions
like "It didn't work" are approximately
useless.
you've reached the other system, but that
there's no program listening at the port
you've specified.
Which port are you expecting to use?
Does "telnet server_host that_port" work, or
do you get "connection refused"?
What makes you believe that your server is
running and listening at the port you're
trying to use?
> I need to recall my connect in client
> repetedly untill the server is up and do
> accept my connect.
So, what's stopping you from doing that?
(Of course, you can burn a lot of CPU and
network resources by retrying this in a
wait-less loop. Also, if no one is listening
at the other end, retrying is not likely to
change much.)
> [...] but ended up in vain.
What does that mean? Symptom descriptions
like "It didn't work" are approximately
useless.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP