Highlighted

Socket - connect multiple clients to a server?

Participant ,
Jan 07, 2018

Copy link to clipboard

Copied

Hi using the following

ServerSocket ServerSocket - Adobe ActionScript® 3 (AS3 ) API Reference

Socket class Socket - Adobe ActionScript® 3 (AS3 ) API Reference

How can you connect more than 1 client to a server?

My problem is when the third clients connects to the server the second client loses its socket connection can no longer send or get data from server.

UPDATE

1 getting Error: Error #2030: End of file was encountered. when second client sends data to server at onClientSocketData in ServerSocketExample

2 When the third client connects The buffer becomes blank and clientSocket.bytesAvailable is 0 at onClientSocketData in ServerSocketExample

3 Ok think i am getting somewhere, when 1 client is connected and sends data to the server the buffer has object data, however when the second client joins the buffer for the first client is now blank when it sends data to the server (the second client buffer has object data).

4. Still having issues with this, i am thinking that when the second client joins the server (3 users connected) it replaces the connection from the first client. The server stops sending data to the first client and when the first client tries and sends data to the server the bytesAvailable is 0.

still having issues connecting more than 1 client to a server, i am thinking that the client connection is overriding itself when a new client joins.

Ok worked it out,

In the ServerSocketExample.as class onConnect function you have to create and store a new event.socket for each connection instead of overriding the one already made.

TOPICS
Development

Views

553

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 - connect multiple clients to a server?

Participant ,
Jan 07, 2018

Copy link to clipboard

Copied

Hi using the following

ServerSocket ServerSocket - Adobe ActionScript® 3 (AS3 ) API Reference

Socket class Socket - Adobe ActionScript® 3 (AS3 ) API Reference

How can you connect more than 1 client to a server?

My problem is when the third clients connects to the server the second client loses its socket connection can no longer send or get data from server.

UPDATE

1 getting Error: Error #2030: End of file was encountered. when second client sends data to server at onClientSocketData in ServerSocketExample

2 When the third client connects The buffer becomes blank and clientSocket.bytesAvailable is 0 at onClientSocketData in ServerSocketExample

3 Ok think i am getting somewhere, when 1 client is connected and sends data to the server the buffer has object data, however when the second client joins the buffer for the first client is now blank when it sends data to the server (the second client buffer has object data).

4. Still having issues with this, i am thinking that when the second client joins the server (3 users connected) it replaces the connection from the first client. The server stops sending data to the first client and when the first client tries and sends data to the server the bytesAvailable is 0.

still having issues connecting more than 1 client to a server, i am thinking that the client connection is overriding itself when a new client joins.

Ok worked it out,

In the ServerSocketExample.as class onConnect function you have to create and store a new event.socket for each connection instead of overriding the one already made.

TOPICS
Development

Views

554

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
Jan 07, 2018 0
Participant ,
Jan 24, 2018

Copy link to clipboard

Copied

still having issues connecting more than 1 client to a server, i am thinking that the client connection is overriding itself when a new client joins.

Ok worked it out,

In the ServerSocketExample.as class onConnect function you have to create and store a new event.socket for each connection instead of overriding the one already made.

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...
Jan 24, 2018 0