<?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>non blocking TCP in nrf9160</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/61051/non-blocking-tcp-in-nrf9160</link><description>Do we have any examples of using tcp in non blocking mode for the NRF9160. I used the USP for PSM example as base for my current project but the blocking call seems to lead to an issue.</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 06 May 2020 14:31:50 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/61051/non-blocking-tcp-in-nrf9160" /><item><title>RE: non blocking TCP in nrf9160</title><link>https://devzone.nordicsemi.com/thread/248518?ContentTypeID=1</link><pubDate>Wed, 06 May 2020 14:31:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9c08e752-f39f-43d6-858e-409e4f6734a7</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;
&lt;p&gt;I&amp;#39;m glad to hear that you found a workaround.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="vchhabra"]Just wondering if there is any way to get an interrupt when new data is available for reading or do we have to poll.[/quote]
&lt;p&gt;&amp;nbsp;A thread with poll() is the way to go. This will essentially be triggered from the modem (via a interrupt) when new data is received (or timeout occurs).&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;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: non blocking TCP in nrf9160</title><link>https://devzone.nordicsemi.com/thread/248487?ContentTypeID=1</link><pubDate>Wed, 06 May 2020 13:30:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eae8bd67-6af7-401b-9d02-82d79c9e63d3</guid><dc:creator>vchhabra</dc:creator><description>&lt;p&gt;yes, setting it is not the issue. I figured it out a little while after posting the ticket. Just wondering if there is any way to get an interrupt when new data is available for reading or do we have to poll.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: non blocking TCP in nrf9160</title><link>https://devzone.nordicsemi.com/thread/248459?ContentTypeID=1</link><pubDate>Wed, 06 May 2020 12:38:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bc9caa1e-af0d-4fac-a86a-273a20a8efc4</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;
&lt;p&gt;Are you setting up the socket to be non-blocking via fcntl()?&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;int flags = fcntl(client_fd, F_GETFL);
fcntl(my_fd, F_SETFL, flags | O_NONBLOCK);&lt;/pre&gt;&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;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>