Error: net_socket_posix

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Agentfox

Every time I try to run my project, I get an error that says

drivers/unix/net_socket_posix.cpp:190 - Socket error: 10054

I’m attaching the project files as well

Could anyone help me please?

(link to the project files via dropbox)

Right now I have a similar problem. I hoping someone can chime in and help. I’m very new at this, so I anticipate my problem being something stupid. Looking forward to some insight.

MisterAcoustic | 2019-04-14 05:29

:bust_in_silhouette: Reply From: GameVisitor

Found ur issue, it was crashing at this instruction : get_point_position(1) with a similar error:

ERROR: set: Condition ' p_index < 0 || p_index >= size() ' is true.
   At: ./core/pool_vector.h:488.

Ugly description I know, but it means you are accessing an out of bound element.
Adding this temporary instruction : var count = get_point_count() showed size=1 (and you were accessing the second element, since 0 based).

In the previous lines, you have:

if get_point_count() < 2:
	add_point(Vector2(0,0))
set_point_position(1, AverageArmyPosition)
set_point_position(2, Destination)

which only adds 1 point (instead of 2 as you were expecting), solution is:

if get_point_count() < 2:
	add_point(Vector2(0,0))
	add_point(Vector2(0,0))
set_point_position(0, AverageArmyPosition)
set_point_position(1, Destination)

If this helps, mark it as accepted. Thanks :slight_smile:

Thanks for the help, but it didn’t work :frowning:

the code now reads:


func _proccess(delta):
    if get_point_count() < 2:
    	    add_point(Vector2(0,0))
	    add_point(Vector2(0,0))
    set_point_position(0, AverageArmyPosition)
    set_point_position(1, Destination)
    if get_point_position(1).abs() - get_point_position(2).abs() < Vector2(1,1):
	    set_point_position(1, Destination)
        var count = get_point_count()
    print(count)
    pass

btw, I’m sorry it took so long to respond, the email was sent to junk

Thanks for the help anyways!

Agentfox | 2019-04-14 16:26

:bust_in_silhouette: Reply From: Agentfox

Hey!

I found the issue!

I just commented out all the individual lines and ran until I found the lines that caused the error and I found that these lines were the ones:

if get_point_position(1).abs() - get_point_position(2).abs() < Vector2(1,1):
	set_point_position(1, Destination)
print(get_point_count())

I’m not sure why this happened, and if anyone knows please post

I told you, you need to use 0 and 1 instead of 1 and 2 (since 0 based index).
This is why, this line:

get_point_position(1).abs() - get_point_position(2).abs()

is crashing. Also make sure your indentation of add_point() are correct.

GameVisitor | 2019-04-14 18:38

Oh yeah!
I feel so dumb now :frowning:

Sorry for the confusion, I’ll go ahead and fix it!

Also someone else is having a similar problem at
Socket Error: 104 - Archive - Godot Forum
could you help them as well?

Agentfox | 2019-04-14 18:40

:bust_in_silhouette: Reply From: Alfredo Oltra

Hi!

Although the problem seems to have been solved, to make one more contribution, I’ve had the same problem, but maybe a little stranger. The same code didn’t give problems in one computer but in another one (same OS, KUbuntu 18.04 updated, but different hardware).

I found the solution commenting this line:

points = $CollisionShape2D.shape.collide_and_get_contacts(
                  $CollisionShape2D.get_global_transform(),
                  get_node("/root/Node2D/Area2D/CollisionShape2D").get_shape(), 
                  get_node("/root/Node2D/Area2D/CollisionShape2D").get_global_transform())

but I don’t know reason

Regards!