<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Failed to create socket, erro code is -12;</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/78165/failed-to-create-socket-erro-code-is--12</link><description>Hi team: 
 After my device runs normally for more than 10 hours, the issue that THE socket cannot be created occasionally occurs. Once the issue occurs, the socket cannot be created until the device is reset.the error code is -12. 
 Once this issue occurs</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 04 Aug 2021 14:12:12 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/78165/failed-to-create-socket-erro-code-is--12" /><item><title>RE: Failed to create socket, erro code is -12;</title><link>https://devzone.nordicsemi.com/thread/323361?ContentTypeID=1</link><pubDate>Wed, 04 Aug 2021 14:12:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b011c024-c0cb-4683-a29e-8a3b2ad5762d</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="pengfeilaw"]ncs1.3.0&amp;nbsp; and modem 1.1.2）[/quote]
&lt;p&gt;Have you tried this on newer modem fw (currently v1.3.0) and ncs version (v1.6.1)?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="pengfeilaw"]&lt;span&gt;The current socket is closed, I can assure you.&lt;/span&gt;&lt;span&gt;However, other sockets may not be closed and are in use. The system can only open one socket at a time？&lt;/span&gt;[/quote]
&lt;p&gt;You can have up to 8 sockets if using regular TCP/UDP, while DTLS/TLS sockets are restricted to 3 sockets simultaneously.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="pengfeilaw"]Is there any way to check which sockets are not closed?[/quote]
&lt;p&gt;No, unfortunately.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failed to create socket, erro code is -12;</title><link>https://devzone.nordicsemi.com/thread/323196?ContentTypeID=1</link><pubDate>Wed, 04 Aug 2021 02:01:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b7c04b2d-009d-4bc1-8e9c-7af9d073a561</guid><dc:creator>pengfeilaw</dc:creator><description>&lt;p&gt;&lt;span class="tgt"&gt;&lt;span&gt;Thank you very much for your reply！&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="tgt"&gt;The current socket is closed, I can assure you.&lt;/span&gt;&lt;span class="tgt"&gt;However, other sockets may not be closed and are in use. The system can only open one socket at a time？&lt;span&gt;Is there any way to check which sockets are not closed?（ncs1.3.0&amp;nbsp; and modem 1.1.2）&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failed to create socket, erro code is -12;</title><link>https://devzone.nordicsemi.com/thread/323009?ContentTypeID=1</link><pubDate>Tue, 03 Aug 2021 07:39:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7e9d232a-48e7-4ff7-a205-6fb189036681</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]&lt;p&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span&gt;After my device runs normally for more than 10 hours, the issue that THE socket cannot be created occasionally occurs. Once the issue occurs, the socket cannot be created until the device is reset.the error code is -12.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp;Once this issue occurs, how can I solve it?&lt;/span&gt;&lt;span&gt;I don&amp;#39;t want to reset the device.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;[/quote]
&lt;p&gt;How are you handling your socket? -12 is ENOMEM, indicating that you are not closing your sockets properly.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>