//..............................................................................
//
// TCP Connection session dispatch interface for IAS
//

import "ias_PluginDispatch.jnc"

//..............................................................................

class TcpConnectionDispatch: ias.PluginDispatch {
	property m_remoteAddress {
		string_t get() {
			return dispatchGet(TcpConnectionDispatchCode.GetRemoteAddress);
		}

		void set(string_t value) {
			dispatch(TcpConnectionDispatchCode.SetRemoteAddress, value);
		}
	}

	property m_remotePort {
		uint_t get() {
			return dispatchGet(TcpConnectionDispatchCode.GetRemotePort);
		}

		void set(uint_t value) {
			dispatch(TcpConnectionDispatchCode.SetRemotePort, value);
		}
	}

	construct(intptr handle) {
		basetype.construct(handle);
	}

	bool errorcode connect(string_t address = null) { // null = use m_remoteAddress
		return dispatch(TcpConnectionDispatchCode.Connect, address);
	}

	void disconnect() {
		dispatch(TcpConnectionDispatchCode.Disconnect);
	}
}

//..............................................................................
