<p>Holger Freyther <strong>uploaded patch set #2</strong> to this change.</p><p><a href="https://gerrit.osmocom.org/10439">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">Allow lua code to register a fd for reading with the runtime<br><br>To have bi-directional communication we can pass credentials to the<br>registry server and now we can register a callback when the registry<br>is sending data to us.<br><br>The callback needs to return if the fd should continue to be selected<br>as I found no way to push the userdata as parameter on the stack. Lua<br>code will look like:<br><br> local host, port = "www.osmocom.org", 80<br> local tcp = socket.tcp()<br> tcp:connect(host, port);<br> tcp:send("GET / HTTP/1.0\r\n\r\n");<br> local cb = function()<br> local s, status, partial = tcp:receive()<br> print(s)<br> if status == 'closed' then<br> tcp:close()<br> return 0<br> end<br> return 1<br> end<br> local foo = osmo.register_fd(tcp:getfd(), cb)<br><br>Change-Id: I8254bdda1df2f8fe0a5eac894b931e7de5b426df<br>---<br>M src/host/layer23/src/mobile/script_lua.c<br>1 file changed, 103 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/39/10439/2</pre><p>To view, visit <a href="https://gerrit.osmocom.org/10439">change 10439</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/10439"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: osmocom-bb </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newpatchset </div>
<div style="display:none"> Gerrit-Change-Id: I8254bdda1df2f8fe0a5eac894b931e7de5b426df </div>
<div style="display:none"> Gerrit-Change-Number: 10439 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: Holger Freyther <holger@freyther.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder (1000002) </div>