Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ MT-multithreading and servers » [SOLVED] TcpSocket Connect error
Re: TcpSocket Connect error [message #42424 is a reply to message #42396] Thu, 13 March 2014 08:28 Go to previous messageGo to previous message
steffen is currently offline  steffen
Messages: 38
Registered: May 2007
Location: Denmark
Member

I used the WaitWrite in the Connect2 function in my example, but checking errno just after the WaitWrite returns, it still shows 115 (EINPROGRESS).
It only works if I call getsockopt afterwards, then optval is set to 111 (Connection refused).

I have improved the logging in my example, so now the output is like this:
Quote:

Test1 Connecting
After Connect: 115 Operation now in progress
Connected
Sending: My Test String
ERROR: 111 Connection refused

Test2 Connecting
After WaitWrite: 115 Operation now in progress
optval: 111 Connection refused
SUCCESS: No Connection to non existing server.


Test1 is getting the error after the first write attempt, but it should have failed on connect.
Test2 calls getsockopt and detects the missing connection correctly.
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: SSL handshake error
Next Topic: How to use Skylark on external server
Goto Forum:
  


Current Time: Wed May 15 05:28:47 CEST 2024

Total time taken to generate the page: 0.02403 seconds