public void connect (String dstaddr, short dstPort) {
		System.out.println("Connecting......");
		this.dstaddr = dstaddr;
		this.dstport = dstPort;
		
		while(true) {
			System.out.println("Sending SYN data");
			clientSendData(null, (short)0, (char)0);//SYN
			
			Datagram datagram = receiveData();
			System.out.println("Receiving server ACK");
			
			timer.interrupt();
			
			TTP ttp = (TTP)datagram.getData();
			int ack = ttp.getACK();
			
			System.out.println("ACK: " + ack + " ExpectSYN: " + expectSYN);
			
			if (ttp.getCategory() == (char)1 && ack == expectSYN) {
				
				System.out.println("Sending SYN + ACK");
				
				ACK = ttp.getSYN() + ttp.getLength();
				SYN = expectSYN;
				
				clientSendData(null, (short)0, (char)2); //SYN + ACK
				isConnected = true;
				System.out.println("connectioin established");
				break;
			}
		}
		System.out.println("Client connecting end");
	}