Skip to main content
Inspiring
December 13, 2017
Answered

socket server and network client connection error 2031

  • December 13, 2017
  • 1 reply
  • 1300 views

Hi I am having an issue with getting a network client to connect to the server 

Server ServerSocketExample.as ServerSocket - Adobe ActionScript® 3 (AS3 ) API Reference 

Client SocketExample.as Socket - Adobe ActionScript® 3 (AS3 ) API Reference

If the client air app runs on the same computer as the server then the clients connects.

Server pc

192.168.1.5

255.255.255.0

gateway 192.168.1.1

Server setup

Local ip 127.0.0.1

Local port 80 (or adjust in client, have tried port 50000)

Now when I put the client on another computer on the same network I get

ioErrorHandler: [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2031: Socket Error. URL: localhost" errorID=2031]

Network Computer

192.168.1.6

255.255.255.0

gateway 192.168.1.1

It does say that

"To run the example, you need a server running on the same domain where the SWF resides (in the example, localhost) and listening on port 80."

Any ideas on how I can get a network client to join the server?

This topic has been closed for replies.
Correct answer veggieman25

Solved it

Server setup

Local ip 192.168.1.5

Local port 80

SocketExample.as

change

socket = new CustomSocket("localhost", 80);

to

socket = new CustomSocket("192.168.1.5", 80);

1 reply

veggieman25AuthorCorrect answer
Inspiring
December 13, 2017

Solved it

Server setup

Local ip 192.168.1.5

Local port 80

SocketExample.as

change

socket = new CustomSocket("localhost", 80);

to

socket = new CustomSocket("192.168.1.5", 80);