<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Non-blocking UDP listener issue</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/bf75f3c741/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Runtime/thread/bf75f3c741/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Runtime/thread/bf75f3c741/</id><updated>2020-02-27T15:18:05.444000Z</updated><subtitle>Recent posts to Non-blocking UDP listener issue</subtitle><entry><title>Non-blocking UDP listener issue</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/bf75f3c741/?limit=100#3198" rel="alternate"/><published>2020-02-27T15:18:05.444000Z</published><updated>2020-02-27T15:18:05.444000Z</updated><author><name>aliazzz</name><uri>https://forge.codesys.com/u/aliazzz/</uri></author><id>https://forge.codesys.comeea0ee73cef068faeed078f0732e388209e31ad3</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi, sorry for budding in.&lt;br/&gt;
Have you tried to program the blocking sockets in a different program with a different task yet?&lt;br/&gt;
If you build your communication in a different task, your main program does not get hindered by blocking communication.&lt;br/&gt;
Another way is to implement communication via asynchronous jobs with a callback. &lt;br/&gt;
Try searching the CODESYS library repo for the job manager (cannot recall what its name is), maybe it can help you out.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Non-blocking UDP listener issue</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/bf75f3c741/?limit=25#f495" rel="alternate"/><published>2020-02-27T15:18:04.808000Z</published><updated>2020-02-27T15:18:04.808000Z</updated><author><name>RichardVerzijl</name><uri>https://forge.codesys.com/u/richardverzijl/</uri></author><id>https://forge.codesys.com72a4f4bdb82bebbb00ab06ad734e68d28e48c984</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi Edwin,&lt;/p&gt;
&lt;p&gt;Function block UDP_Receive is also blocking.&lt;br/&gt;
But I have used UDP_Receive in a separate task so now it doesn't matter that is it blocking.&lt;/p&gt;
&lt;p&gt;Thanks,&lt;br/&gt;
Richard&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Non-blocking UDP listener issue</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/bf75f3c741/?limit=25#e170" rel="alternate"/><published>2020-02-27T15:18:02.981000Z</published><updated>2020-02-27T15:18:02.981000Z</updated><author><name>eschwellinger</name><uri>https://forge.codesys.com/u/eschwellinger/</uri></author><id>https://forge.codesys.com415306335ece613f9e10f076ca5094bf62130540</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi Richard,&lt;/p&gt;
&lt;p&gt;I would recommend to use this project from that forum post based on netbase services:&lt;br/&gt;
 l &lt;a class="" href="http://forum.codesys.com/viewtopic.php?f=21&amp;amp;t=6625&amp;amp;hilit=UDP+raspberry&amp;amp;p=13743&amp;amp;lan=en" rel="nofollow"&gt;viewtopic.php?f=21&amp;amp;t=6625&amp;amp;hilit=UDP+raspberry#p13743&lt;/a&gt; l &lt;/p&gt;
&lt;p&gt;BR&lt;br/&gt;
Edwin&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Non-blocking UDP listener issue</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/bf75f3c741/?limit=25#e7ba" rel="alternate"/><published>2020-02-27T15:18:02.346000Z</published><updated>2020-02-27T15:18:02.346000Z</updated><author><name>RichardVerzijl</name><uri>https://forge.codesys.com/u/richardverzijl/</uri></author><id>https://forge.codesys.combe8a173c1abb725986c867326f9ba68f1d5bf415</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I want to create a UDP listener that is non-blocking.&lt;br/&gt;
To do so I use SysSockSelect function. The problem is that the value diReady (Number of sockets that are ready for IO) never becomes 1.&lt;br/&gt;
The code I have is:&lt;/p&gt;
&lt;p&gt;tvTimeout.tv_sec:= 0;&lt;br/&gt;
tvTimeout.tv_usec:= 0;&lt;br/&gt;
fdRead.fd_count:= 1;&lt;br/&gt;
fdRead.fd_array&lt;span&gt;[0]&lt;/span&gt;:= hListenSocket;&lt;br/&gt;
Socket_Result := NBS.SysSockSelect(NBS.SOCKET_FD_SETSIZE, ADR(fdRead), 0, 0, ADR(tvTimeout), ADR(diReady));&lt;/p&gt;
&lt;p&gt;I am sure data is ready for IO because when I call the function SysSockRecv data is read.&lt;/p&gt;
&lt;p&gt;The same code I use in CoDeSys v2.3 and there it works.&lt;/p&gt;
&lt;p&gt;Does anyone know why this doesn't work in v3.5 SP10?&lt;/p&gt;
&lt;p&gt;Thanks,&lt;br/&gt;
Richard&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>