• python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Facebook Twitter Instagram
Devs Fixed
  • python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Devs Fixed
Home ยป Resolved: How to deal with exceptions in IO::Socket::INET?

Resolved: How to deal with exceptions in IO::Socket::INET?

0
By Isaac Tonny on 18/06/2022 Issue
Share
Facebook Twitter LinkedIn

Question:

Assume there’s no application listening at port 12340 in localhost.
Shouldn’t the command below print “error” ?

Answer:

The current implementation of nqp::connect, the underlying logic to make the connection, throws an X::AdHoc exception. Having IO::Socket::INET.new return a Failure if not able to connect, would make more sense to me indeed.
I’ve created a Pull Request to create this behaviour.
Until then, you can use the same code change locally:

If you have better answer, please add a comment about this, thank you!

raku
Share. Facebook Twitter LinkedIn

Related Posts

Resolved: Reshape tensors of unknown shape with tf.function

26/03/2023

Resolved: Use Svelte Component as Slot

26/03/2023

Resolved: Vaadin 14.9 – Redirect on Session Destroy Event

26/03/2023

Leave A Reply

© 2023 DEVSFIX.COM

Type above and press Enter to search. Press Esc to cancel.