<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[wolfSSL - Embedded SSL Library — Weird "error state on socket" with simple code.]]></title>
		<link>https://www.wolfssl.com/forums/topic272-weird-error-state-on-socket-with-simple-code.html</link>
		<atom:link href="https://www.wolfssl.com/forums/feed-rss-topic272.xml" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Weird "error state on socket" with simple code..]]></description>
		<lastBuildDate>Thu, 01 Nov 2012 03:21:50 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Weird "error state on socket" with simple code.]]></title>
			<link>https://www.wolfssl.com/forums/post745.html#p745</link>
			<description><![CDATA[<p>My socket on the server is simple as that, the client get the same parameters:</p><br /><div class="codebox"><pre><code>int Cssl_layer::open_listener(int port)
{
        int sd;
    struct sockaddr_in addr;

    sd = socket(PF_INET, SOCK_STREAM, 0);
    addr.sin_family = AF_INET;
    addr.sin_port = htons(port);
    addr.sin_addr.s_addr = INADDR_ANY;
    if ( bind(sd, (struct sockaddr*)&amp;addr, sizeof(addr)) != 0 )
    {
        perror(&quot;can&#039;t bind port&quot;);
        abort();
    }
    if ( listen(sd, 10) != 0 )
    {
        perror(&quot;Can&#039;t configure listening port&quot;);
        abort();
    }

    sleep(3);
    printf(&quot;socket binded.\r\n&quot;);
    return sd;
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (unkode909)]]></author>
			<pubDate>Thu, 01 Nov 2012 03:21:50 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post745.html#p745</guid>
		</item>
		<item>
			<title><![CDATA[Weird "error state on socket" with simple code.]]></title>
			<link>https://www.wolfssl.com/forums/post744.html#p744</link>
			<description><![CDATA[<p>Hi I&#039;m compiling a simple server - client with CyaSSL embedded SSL.<br />My client and server compile well and the client can connect to web SSL server pages without any problem.</p><p>However, when it bind to my server i got a &quot;error state on socket&quot;, see below.<br />- I wait 3 seconds before the tcp socket bind or connect before going with the SSL accept or SSL connect layer.<br />- My tcp socket are quite very standard without any fency parameters.</p><p>Do someone have a clue about what this mean?</p><p>env:<br />- Library and program compiled on a 32bits Linux Mint<br />- Using code::blocks 10.05</p><p>Server side output:<br /></p><div class="codebox"><pre><code>[...]
CyaSSL Leaving SSL_new, return 0
CyaSSL Entering SSL_set_fd
CyaSSL Leaving SSL_set_fd, return 1
CyaSSL Entering SSL_accept()
growing input buffer

Embed Receive error
    General error
CyaSSL error occured, error = -208
CyaSSL Entering SSL_get_error
CyaSSL Leaving SSL_get_error, return -208
CyaSSL Entering ERR_error_string
Error connecting: [-1] error state on socket
CyaSSL Entering SSL_get_fd
CyaSSL Leaving SSL_get_fd, return -1
CyaSSL Entering SSL_free
CTX ref count not 0 yet, no free
Shrinking input buffer

CyaSSL Entering BIO_free
CyaSSL Leaving SSL_free, return 0</code></pre></div><p>Client side output:<br /></p><div class="codebox"><pre><code>[...]
CyaSSL Leaving SSL_new, return 0
CyaSSL Entering SSL_set_fd
CyaSSL Leaving SSL_set_fd, return 1
CyaSSL Entering SSL_connect()
growing output buffer

Shrinking output buffer

connect state: CLIENT_HELLO_SENT
growing input buffer

Embed receive connection closed
CyaSSL error occured, error = -208
CyaSSL Entering SSL_get_error
CyaSSL Leaving SSL_get_error, return -208
CyaSSL Entering ERR_error_string
SSLsetfd: 1Error connecting: [-1] error state on socket
Abort on error!</code></pre></div><p>thanks. unkode</p>]]></description>
			<author><![CDATA[null@example.com (unkode909)]]></author>
			<pubDate>Thu, 01 Nov 2012 03:11:19 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post744.html#p744</guid>
		</item>
	</channel>
</rss>
