I created a Socket and a ServerSocket objects in as3, then I connected the socket using the connect method by passing to it a host and a port. Also I made the ServerSocket object listening for incoming connection from socket other than the socket I’ve just created. When the ServerSocket detects a connection and start receiving data, the socket object is disconnected automatically. So I want to know how to keep the connection alive in the socket object..
Share
I’m posting this as an answer rather than just referencing this question as a duplicate because your issue is not exactly the same as the question and answer I’m going to reference here. The answer I’m linking to however provides resources that will help you understand the security model behind connecting sockets, which I believe is the issue here:
air 2.6 serversocket and actionscript 3 socket connection
An excerpt from the linked resource which demonstrates a “handshake” where the policy file is passed to the connecting socket: