public void connect (String dstaddr, short dstPort) {
		System.out.println("Connecting......");
		
		int ack = 0;
		
		this.dstaddr = dstaddr;
		this.dstport = dstPort;
		
		while (connectStatus == 0) {
			System.out.println("Sending SYN data");
			clientSendData(null, (short)1, (char)0, 5);//SYN
			
			Datagram datagram = receiveData();
			timer.interrupt();
			timer = null;
			if (datagram == null) {
				return;
			}
			
			TTP ttp = (TTP)datagram.getData();
			ack = ttp.getACK();
			
			if (ttp.getCategory() == (char)1 && ack == expectSYN) {				
				connectStatus = 1;
				ACK = ttp.getSYN() + ttp.getLength();
				SYN = expectSYN;
			}
		}
			
		clientSendData(null, (short)1, (char)2, 1); //SYN + ACK
		
		connectStatus = 2;

		System.out.println("connectioin established");
	}