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

Socket - connect multiple clients to a server?

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

TOPICS
Development

Views

685

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
community guidelines

correct answers 1 Correct answer

Participant , Jan 24, 2018 Jan 24, 2018

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.

Votes

Translate

Translate
Participant ,
Jan 24, 2018 Jan 24, 2018

Copy link to clipboard

Copied

LATEST

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.

Votes

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
community guidelines