package tests;

import java.io.DataInputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.Socket;

/** Scrap code for bug hunting in Windows Vista 
 * There is something wrong with their TCP/IP stack.
 * 
 * 			*pretends to act surprised*
 *  
 * */
public class NetConnTest {
	public static void main(String[] args) {
		try {
			Socket s;
			s = new Socket("wsservices-1.jet.uk", 8765);
		
			 byte b[] = new byte[]{ 0x00, 0x00, 0x00, 0x3b, 0x00, 0x00, 0x00, 0x00 
				, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x0e, (byte)(int)0x83, 0x00
				, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
				, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
				, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
				, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
				, 0x6a, 0x61, 0x76, 0x61, 0x2d, 0x63, 0x6c, 0x69
				, 0x65, 0x6e, 0x74, };
			
			InputStream ins =  s.getInputStream();
			//InputStreamReader r = new InputStreamReader(ins);
			DataInputStream d = new DataInputStream(ins);
			
			
			OutputStream os = s.getOutputStream();
			os.write(b);
			os.flush();
			
			System.out.println(d.readInt());
		
		} catch (Exception e) {
			// TODO Auto-generated catch block
			throw new RuntimeException(e);
		}
		
	}
}
