Android – inputStream.read() – I can not read anything-Collection of common programming errors

I have a problem with read data from socket. I was trying solve my problem in different way and i think my code now is the simplest possible to test it. Android have a problem to read from socket and stop in this line( inStream.read() ). After 10s( socket.setSoTimeout ) i have a message ——-error: null. I want to read any data( 0-255 ) or -1, but nothing has happend. In PHP( on my server, my code) and PC( not my app ) everything is fine. What should I do?

It is my first post, so i am sorry for possible mistakes. Thanks for your help!

try{
    socket      = new Socket( "192.168.0.150", 502 );
    socket.setSoTimeout( 10000 );

    outStream   = new DataOutputStream( socket.getOutputStream() );
    inStream    = new DataInputStream( socket.getInputStream() );

    System.out.println("----------" + outStream);
    System.out.println("----------" + inStream );

    outStream.write( 0x01 );
    outStream.write( 0x03 );
    outStream.write( 0x10 );
    outStream.write( 0x00 );
    outStream.write( 0x00 );
    outStream.write( 0x04 );
    outStream.write( 0x40 );
    outStream.write( 0xC9 );

    outStream.flush();
    System.out.println("----------ok 1");

/////////////////////////////               

//  Thread.sleep( 50 );
    System.out.println("----------Test1: " + socket.isConnected() );
    System.out.println("----------Test2: " + socket.isInputShutdown() );

    int dat = inStream.read();
    System.out.println("----------ok2: " );
} catch( Exception e ){
    e.printStackTrace(); //