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

How to know fast if another computer is accesible in a LAN AS3 (Adobe Air)

New Here ,
Jun 16, 2015 Jun 16, 2015

Copy link to clipboard

Copied

I'm using FileStream to read files in two computers that are connected in a Local Area Network (LAN). I have no problem to read the files when the others computers are connected. I'm checking if the directory exists before writing the file I'm checking if the directory AND the file exists before reading the file.

file_pc1 = new File("//OTHER-PC/Folder/file.csv"); 
directory = new File("//OTHER-PC/Folder");
if (directory_pc1.exists)
{
     stream.open(file_pc1, FileMode.WRITE);
     stream.writeUTFBytes(csv.data);
     stream.close();
}
if (directory_pc1.exists && file_pc1.exists)
{
     stream.open(file_pc1, FileMode.READ);
     stream.writeUTFBytes(csv.data);
     stream.close();
}

All this works great but if the other computer is not connected, the statements directory_pc1.exists and file_pc1.exists takes a very long time and the app freezes, sometime even sending the "Application is not responding" message from Windows, but it finally responds after a long time.

Is there a fastest way to check if i'm connected to another PC?

TOPICS
Development

Views

230

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
Advocate ,
Jun 16, 2015 Jun 16, 2015

Copy link to clipboard

Copied

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
Community Beginner ,
Jun 18, 2015 Jun 18, 2015

Copy link to clipboard

Copied

LATEST

Please, view my post, may be can use this tip: https://forums.adobe.com/thread/1876631

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