# SocketConnect causes unrecoverable error on invalid address string

**URL:** <https://tech-community.robotics.abb.com/t/socketconnect-causes-unrecoverable-error-on-invalid-address-string/9644>\
**Category:** RAPID Programming\
**Tags:** answered, network\
**Created:** [August 11, 2020, 1:15pm UTC](https://tech-community.robotics.abb.com/t/socketconnect-causes-unrecoverable-error-on-invalid-address-string/9644 "2020-08-11T13:15:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![FlorianAumann](https://avatars.discourse-cdn.com/v4/letter/f/a9a28c/32.png) [@FlorianAumann](https://tech-community.robotics.abb.com/u/FlorianAumann)\
**Post date:** [August 11, 2020, 1:15pm UTC](https://tech-community.robotics.abb.com/t/socketconnect-causes-unrecoverable-error-on-invalid-address-string/9644/1 "2020-08-11T13:15:09Z")

</div>

When trying to start a socket connection as a client using the _SocketConnect_ command,

I ran into the issue that this command will cause an unrecoverable error on my system in case the address string is invalid. (I am currently running RobotWare 6.08.01)

From what I found out so far, an “invalid” IP address can be a malformed IP string, but apparently also IP addresses that are outside of the robot’s subnet. Since the IP address I connect to is defined dynamically, I would like to be able to handle this issue in my program in case the address is invalid rather than just stopping everything.

Since its an unrecoverable error, I assume there is no option for error handling for me here. But is there a way to check, if a string represents a valid, reachable IP address before passing it to _SocketConnect_?

---

<div class="post-metadata">

**Author:** ![FlorianAumann](https://avatars.discourse-cdn.com/v4/letter/f/a9a28c/32.png) [@FlorianAumann](https://tech-community.robotics.abb.com/u/FlorianAumann)\
**Post date:** [August 12, 2020, 8:52am UTC](https://tech-community.robotics.abb.com/t/socketconnect-causes-unrecoverable-error-on-invalid-address-string/9644/2 "2020-08-12T08:52:48Z")

</div>

Error is the same as the one described in [here](https://forums.robotstudio.com/discussion/11335/socket-messaging-using-factory-network)

---

<div class="post-metadata">

**Author:** ![FlorianAumann](https://avatars.discourse-cdn.com/v4/letter/f/a9a28c/32.png) [@FlorianAumann](https://tech-community.robotics.abb.com/u/FlorianAumann)\
**Post date:** [July 7, 2021, 10:30am UTC](https://tech-community.robotics.abb.com/t/socketconnect-causes-unrecoverable-error-on-invalid-address-string/9644/3 "2021-07-07T10:30:18Z")

</div>

Update on this: Looks like this issue has been improved in RW 6.10.02, where _SocketConnect_ now throws recoverable errors in this situation and we can use the new error codes **ERR\_SOCK\_UNSPEC** and **ERR\_SOCK\_ADDR\_INVALID** to catch these errors.
