when reading off a socket, that is closed, you will get: Error #2002: Operation attempted on invalid socket.
end-of-file errors typically occur on any bytestreams, if you read more bytes than available ... this is the case for files, sockets, etc. ... in the case of flash, it occurs when reading from a Socket
or a ByteArray
and maybe even in other cases ...
TCP/IP is package based, but emulates a stream ... thus you can only read the data off the stream, that was already sent to you with TCP packages ... check Socket::bytesAvailable
to find out, how many bytes are currently available ... always keep in mind, that the data you write to the socket in one operation, may arrive in multiple packages, each very probably causing flash player to trigger socketData
events ...