//..............................................................................
//
// UDP Socket session dispatch interface for IAS
//

import "ias_PluginDispatch.jnc"

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

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

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

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

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

	property m_localPort {
		uint_t get() {
			return dispatchGet(UdpDispatchCode.GetLocalPort);
		}

		void set(uint_t value) {
			dispatch(UdpDispatchCode.SetLocalPort, value);
		}
	}

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

	bool errorcode open() {
		return dispatch(UdpDispatchCode.Open);
	}

	bool errorcode open(uint_t port) {
		dispatch(UdpDispatchCode.SetLocalPort, port);
		return dispatch(UdpDispatchCode.Open);
	}

	void close() {
		dispatch(UdpDispatchCode.Close);
	}
}

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