Highlighted

Socket Server connect to network client error 2031

Participant ,
Dec 12, 2017

Copy link to clipboard

Copied

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?

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.

TOPICS
Development

Views

1.6K

Likes

Translate

Translate

Report

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

Socket Server connect to network client error 2031

Participant ,
Dec 12, 2017

Copy link to clipboard

Copied

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?

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.

TOPICS
Development

Views

1.6K

Likes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Dec 13, 2017 0
Participant ,
Dec 13, 2017

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Dec 13, 2017 0
Participant ,
Dec 13, 2017

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Dec 13, 2017 0
Participant ,
Dec 14, 2017

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Dec 14, 2017 0