Giter VIP home page Giter VIP logo

Comments (13)

orthecreedence avatar orthecreedence commented on September 26, 2024

Try now =]

from carrier.

nightshade427 avatar nightshade427 commented on September 26, 2024

Thanks for getting back so fast. :)

I get the same hang, but, now I dont get a response at all when it connects.
I used to get a result when doing this, now I just get "CARRIER::BODY" which is strange.

CL-USER> (as:with-event-loop ()                                                                                         
           (bb:catcher                                                                                                  
            (bb:alet ((result (carrier:request "https://www.apple.com/" :return-body t)))                               
              (format t "result: ~s" result))                                                                           
            (t (e) (format t "error: ~a" e))))                                                                          
result: CARRIER::BODY

This still hangs :(

CL-USER> (as:with-event-loop ()                                                                                         
           (bb:catcher                                                                                                  
            (bb:alet ((result (carrier:request "https://www.apple.com:999/" :return-body t)))                           
              (format t "result: ~s" result))                                                                           
            (t (e) (format t "error: ~a" e))))

from carrier.

nightshade427 avatar nightshade427 commented on September 26, 2024

I will start to dig in and see if I can find out why "CARRIER:BODY" symbol is being returned vs the data it points to. I'll let you know if I find anything out. Let me know if I can help test anything.

from carrier.

nightshade427 avatar nightshade427 commented on September 26, 2024

Okay tracked it down a bit more:

This works and gives result:

CL-USER> (as:with-event-loop ()                                                                                         
           (bb:catcher                                                                                                  
            (bb:alet ((result (bb:with-promise (res rej)                                                                
                                (let ((x 4))                                                                            
                                  (res x)))))                                                                           
              (format t "result: ~s" result))                                                                           
            (t (e) (format t "error: ~a" e))))                                                                          
result: 4

This seems to give the symbol back instead of evuating it:

CL-USER> (as:with-event-loop ()                                                                                         
           (bb:catcher                                                                                                  
            (bb:alet ((result (bb:with-promise (res rej)                                                                
                                (let ((x 4))                                                                            
                                  (res x x)))))                                                                         
              (format t "result: ~s" result))                                                                           
            (t (e) (format t "error: ~a" e))))                                                                          
; in: CL-ASYNC:WITH-EVENT-LOOP ()                                                                                       
;     (LET ((X 4))                                                                                                      
;       (RES X X))                                                                                                      
;                                                                                                                       
; caught STYLE-WARNING:                                                                                                 
;   The variable X is defined but never used.                                                                           
;                                                                                                                       
; compilation unit finished                                                                                             
;   caught 1 STYLE-WARNING condition                                                                                    
result: X

from carrier.

nightshade427 avatar nightshade427 commented on September 26, 2024

Changing promise.lisp:L117 from

`(apply ,',resolve-fn ',args))))

To

`(funcall ,',resolve-fn ,@args))))

Seems to fix it, but not sure that is best way

from carrier.

nightshade427 avatar nightshade427 commented on September 26, 2024

I will make a pull request for the above in blackbird when I get a chance here shortly

from carrier.

nightshade427 avatar nightshade427 commented on September 26, 2024

okay pull request made orthecreedence/blackbird#18

from carrier.

nightshade427 avatar nightshade427 commented on September 26, 2024

This just fixes data being returned when it can connect. It doesnt fix the initial hanging issue. It still hangs when it cannot connect.

from carrier.

orthecreedence avatar orthecreedence commented on September 26, 2024

Thanks for the PR!

Thinking about it more, this may be a system issue. I think if you don't specify a timeout, some *nix systems will hold the connection open for quite a long time. Does setting :timeout 20 in the carrier:request call help at all? Keep in mind this is a read timeout, so each time data is read the timeout is reset.

from carrier.

nightshade427 avatar nightshade427 commented on September 26, 2024

The issue seems to be when trying to connect to a host:port that isnt open, it just hangs carrier instead of erroring out with cannot connect.

from carrier.

orthecreedence avatar orthecreedence commented on September 26, 2024

Nick, are you still seeing this? With master cl-async/libuv/carrier I'm not seeing hangs in windows/ccl, linux/ccl, linux/sbcl at all. They eventually time out with an error (passed to the promise).

from carrier.

nightshade427 avatar nightshade427 commented on September 26, 2024

Yeah, it times out now for me too :)

Should it timeout or fail right away when a connection is refused?

from carrier.

orthecreedence avatar orthecreedence commented on September 26, 2024

I think there's some ambiguity as to whether the connection is refused or not. If you were to try it locally, it would probably say "connection refused" but with remote servers, a timeout is generally how it responds. I'm not really sure how TCP differentiates, TBH. I think it might be a function of the underlying OS.

from carrier.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.