Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
Locked
0

Socket Server connect to network client error 2031

Participant ,
Dec 12, 2017 Dec 12, 2017

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?

TOPICS
Development
3.0K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Participant , Dec 13, 2017 Dec 13, 2017

You should try connecting to 192.168.1.5 (or whatever the IP is of the server) instead of localhost if the client is on another computer.

Translate
Participant ,
Dec 13, 2017 Dec 13, 2017

You should try connecting to 192.168.1.5 (or whatever the IP is of the server) instead of localhost if the client is on another computer.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Dec 13, 2017 Dec 13, 2017

That is correct just worked it out here socket server and network client connection error 2031

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Dec 13, 2017 Dec 13, 2017

Also, low ports (below 1024) are not recommended to use. Port 80 is usually used for http servers and depending on the software environment of your computers you might easily run into trouble, especially if you want to distribute the app to other users as well.

It's recommended pick a higher port which is not used widely

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Dec 14, 2017 Dec 14, 2017
LATEST

A side question

With the client SocketExample.as  Socket - Adobe ActionScript® 3 (AS3 ) API Reference

How can the client send a new message to the server from outside of the CustomSocket class?

Update

worked it out need a send function for socket connection

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines