Quantcast
Channel: Adobe Community : Popular Discussions - AIR Development
Viewing all articles
Browse latest Browse all 24121

iOS Sockets: Error #2002: Operation attempted on invalid socket.

$
0
0

Hey All,

 

If anyone has a fix for this it would be greatly appreciated, or just let me know if I'm missing something, but I can't seem to get a port open while running on iOS. I've read a lot of reasons for this is that the port is still in-use from a previous session of the application that failed to close the port properly, but that is simply not there case here. To test this, I've tried looping through a variety of different port ranges on application start, and this error occurs on every port attempted...

 

import flash.net.ServerSocket;

import flash.net.Socket;

...

 

for (var port:Number = 1000; port <=1020; port++){

    var serverSocket:ServerSocket = new ServerSocket();

    serverSocket.addEventListener(Event.CONNECT, socketConnectHandler);

    serverSocket.bind(port);

    serverSocket.listen();   

}

 

it breaks every time on serverSocket.bind(port) with "Error #2002: Operation attempted on invalid socket.";

 

Any help would be greatly appreciated. Also, I'm using Flash Builder 4.6 compiling to Flex 4.6.0 SDK.

 

Thanks!


Viewing all articles
Browse latest Browse all 24121

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>