<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif;">
<div>This is a general question about asynchronous programming, not specific to NDN-JS, and not even specific to NDN. This is how all async programming works. expressInterest is “non-blocking”. You call the expressInterest method to give callbacks to the system
 and the method returns immediately, “non-blocking”. When the system completes the task, it calls the callback.</div>
<div><br>
</div>
<div>- Jeff T</div>
<div><br>
</div>
<span id="OLK_SRC_BODY_SECTION">
<div style="font-family:Calibri; font-size:11pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt">
<span style="font-weight:bold">From: </span>Ndn-interest <<a href="mailto:ndn-interest-bounces@lists.cs.ucla.edu">ndn-interest-bounces@lists.cs.ucla.edu</a>> on behalf of Giuseppe Carella <<a href="mailto:gcarella228@gmail.com">gcarella228@gmail.com</a>><br>
<span style="font-weight:bold">Date: </span>Monday, November 6, 2017 at 5:58:00<br>
<span style="font-weight:bold">To: </span>"<a href="mailto:ndn-interest@lists.cs.ucla.edu">ndn-interest@lists.cs.ucla.edu</a>" <<a href="mailto:ndn-interest@lists.cs.ucla.edu">ndn-interest@lists.cs.ucla.edu</a>>, nfd-dev <<a href="mailto:nfd-dev@lists.cs.ucla.edu">nfd-dev@lists.cs.ucla.edu</a>><br>
<span style="font-weight:bold">Subject: </span>[Ndn-interest] face_object<br>
</div>
<div><br>
</div>
<div>
<div>
<div dir="ltr">
<div>
<div>
<div>
<div>
<div>
<div>
<div>Good morning community,<br>
<br>
</div>
can someone explain me the bahavior of the face.expressInterest method in ndn-js?<br>
</div>
I understood that it has the aim to launch the callbacks onData and onTimeOut, but I don't understand how it is possible that this object doesn't work like a tcpListener.
<br>
</div>
It doesn't wait that one of the callbacks (onData or onTimeOut) returns something.<br>
</div>
It seems that this object launches the callbacks without waiting for the result of one of those two callbacks. </div>
<br>
</div>
Thank you.<br>
</div>
Giuseppe.<br>
</div>
</div>
</div>
</span>
</body>
</html>