avm2: Set timeout in AS3 constructor

This commit is contained in:
sleepycatcoding 2023-07-17 19:11:09 +03:00 committed by Nathan Adams
parent 568d8dfe11
commit 5144162e68
2 changed files with 2 additions and 2 deletions

View File

@ -11,6 +11,7 @@ package flash.net {
public class Socket extends EventDispatcher implements IDataOutput, IDataInput { public class Socket extends EventDispatcher implements IDataOutput, IDataInput {
public function Socket(host:String = null, port:int = 0) { public function Socket(host:String = null, port:int = 0) {
this.timeout = 20000;
if (host != null) { if (host != null) {
this.connect(host, port); this.connect(host, port);
} }

View File

@ -24,8 +24,7 @@ pub fn socket_allocator<'gc>(
// Default endianness is Big. // Default endianness is Big.
endian: Cell::new(Endian::Big), endian: Cell::new(Endian::Big),
object_encoding: Cell::new(ObjectEncoding::Amf3), object_encoding: Cell::new(ObjectEncoding::Amf3),
// Default is 20_000 milliseconds or 20 seconds. timeout: Cell::new(0),
timeout: Cell::new(20000),
handle: Cell::new(None), handle: Cell::new(None),
read_buffer: RefCell::new(vec![]), read_buffer: RefCell::new(vec![]),
write_buffer: RefCell::new(vec![]), write_buffer: RefCell::new(vec![]),