    indexing
    	description: "Network datagram sockets"
    	legal: "See notice at end of class."
    	status: "See notice at end of class."
    	date: "$Date: 2006-01-22 18:25:44 -0800 (Sun, 22 Jan 2006) $"
    	revision: "$Revision: 56675 $"

    class interface
    	NETWORK_DATAGRAM_SOCKET

    create
    	make
    			-- Make a network datagram socket.
    		require -- from  DATAGRAM_SOCKET
    			True
    		ensure then
    			timeout_set_to_default: timeout = default_timeout

    	make_client_by_port (a_peer_port: INTEGER_32; a_peer_host: STRING_8)
    		require
    			valid_peer_host: a_peer_host /= Void and then not a_peer_host.empty
    			valid_port: a_peer_port >= 0

    	make_bound_client_by_port (a_local_port, a_peer_port: INTEGER_32; a_peer_host: STRING_8)
    		require
    			valid_peer_host: a_peer_host /= Void and then not a_peer_host.empty
    			valid_port: a_peer_port >= 0

    	make_server_by_port (a_port: INTEGER_32)
    		require
    			valid_port: a_port >= 0

    	make_bound (a_port: INTEGER_32)
    			-- Make a network datagram socket bound to its well
    			-- known local address with port `a_port'.
    		ensure
    			timeout_set_to_default: timeout = default_timeout

    	make_targeted_to_hostname (a_hostname: STRING_8; a_peer_port: INTEGER_32)
    			-- Make a network datagram socket connected to
    			-- hostname `a_hostname' and port `a_port'.
    		ensure
    			timeout_set_to_default: timeout = default_timeout

    	make_targeted_to_ip (an_ip_number: STRING_8; a_peer_port: INTEGER_32)
    			-- Make a network datagram socket connected to
    			-- hostname `a_hostname' and port `a_port'.
    		ensure
    			timeout_set_to_default: timeout = default_timeout

    feature -- Initialization

    	create_from_descriptor (fd: INTEGER_32)
    			-- Create socket from descriptor `fd'.
    			-- (from NETWORK_SOCKET)
    		require -- from  SOCKET
    			True
    		ensure -- from SOCKET
    			family_valid: family = address.family
    			opened_all: is_open_write and is_open_read
    		ensure then -- from NETWORK_SOCKET
    			timeout_set_to_default: timeout = default_timeout

    	make
    			-- Make a network datagram socket.
    		require -- from  DATAGRAM_SOCKET
    			True
    		ensure then
    			timeout_set_to_default: timeout = default_timeout

    	make_bound (a_port: INTEGER_32)
    			-- Make a network datagram socket bound to its well
    			-- known local address with port `a_port'.
    		ensure
    			timeout_set_to_default: timeout = default_timeout

    	make_targeted_to_hostname (a_hostname: STRING_8; a_peer_port: INTEGER_32)
    			-- Make a network datagram socket connected to
    			-- hostname `a_hostname' and port `a_port'.
    		ensure
    			timeout_set_to_default: timeout = default_timeout

    	make_targeted_to_ip (an_ip_number: STRING_8; a_peer_port: INTEGER_32)
    			-- Make a network datagram socket connected to
    			-- hostname `a_hostname' and port `a_port'.
    		ensure
    			timeout_set_to_default: timeout = default_timeout

    feature -- Access

    	generating_type: STRING_8
    			-- Name of current object's generating type
    			-- (type of which it is a direct instance)
    			-- (from ANY)

    	generator: STRING_8
    			-- Name of current object's generating class
    			-- (base class of the type of which it is a direct instance)
    			-- (from ANY)

    	retrieved: ANY
    			-- Retrieved object structure
    			-- To access resulting object under correct type,
    			-- use assignment attempt.
    			-- Will raise an exception (code Retrieve_exception)
    			-- if content is not a stored Eiffel structure.
    			-- (from SOCKET)
    		require -- from IO_MEDIUM
    			is_readable: readable
    			support_storable: support_storable
    		require else -- from SOCKET
    			socket_exists: exists
    			opened_for_read: is_open_read
    			support_storable: support_storable
    		ensure -- from IO_MEDIUM
    			result_exists: Result /= Void

    feature -- Comparison

    	frozen deep_equal (some: ANY; other: like arg #1): BOOLEAN
    			-- Are `some' and `other' either both void
    			-- or attached to isomorphic object structures?
    			-- (from ANY)
    		ensure -- from ANY
    			shallow_implies_deep: standard_equal (some, other) implies Result
    			both_or_none_void: (some = Void) implies (Result = (other = Void))
    			same_type: (Result and (some /= Void)) implies some.same_type (other)
    			symmetric: Result implies deep_equal (other, some)

    	frozen equal (some: ANY; other: like arg #1): BOOLEAN
    			-- Are `some' and `other' either both void or attached
    			-- to objects considered equal?
    			-- (from ANY)
    		ensure -- from ANY
    			definition: Result = (some = Void and other = Void) or else ((some /= Void and other /= Void) and then some.is_equal (other))

    	is_equal (other: like Current): BOOLEAN
    			-- Is `other' attached to an object considered
    			-- equal to current object?
    			-- (from ANY)
    		require -- from ANY
    			other_not_void: other /= Void
    		ensure -- from ANY
    			symmetric: Result implies other.is_equal (Current)
    			consistent: standard_is_equal (other) implies Result

    	frozen standard_equal (some: ANY; other: like arg #1): BOOLEAN
    			-- Are `some' and `other' either both void or attached to
    			-- field-by-field identical objects of the same type?
    			-- Always uses default object comparison criterion.
    			-- (from ANY)
    		ensure -- from ANY
    			definition: Result = (some = Void and other = Void) or else ((some /= Void and other /= Void) and then some.standard_is_equal (other))

    	frozen standard_is_equal (other: like Current): BOOLEAN
    			-- Is `other' attached to an object of the same type
    			-- as current object, and field-by-field identical to it?
    			-- (from ANY)
    		require -- from ANY
    			other_not_void: other /= Void
    		ensure -- from ANY
    			same_type: Result implies same_type (other)
    			symmetric: Result implies other.standard_is_equal (Current)

    feature -- Status report

    	address: NETWORK_SOCKET_ADDRESS
    			-- Local address of socket
    			-- (from NETWORK_SOCKET)

    	address_in_use: BOOLEAN
    			-- Address is in use by another socket.
    			-- (from SOCKET_RESOURCES)

    	address_not_readable: BOOLEAN
    			-- Unreadable address
    			-- (from SOCKET_RESOURCES)

    	already_bound: BOOLEAN
    			-- Socket has already been bound.
    			-- (from SOCKET_RESOURCES)

    	bad_socket_handle: BOOLEAN
    			-- Socket descriptor is bad.
    			-- (from SOCKET_RESOURCES)

    	bound: BOOLEAN
    			-- Has socket been bound?
    			-- (from DATAGRAM_SOCKET)

    	broadcast_enabled: BOOLEAN
    			-- Is broadcasting enabled?
    		require
    			valid_descriptor: exists

    	bytes_read: INTEGER_32
    			-- Last number of bytes read by read_to_managed_pointer.
    			-- (from IO_MEDIUM)

    	conforms_to (other: ANY): BOOLEAN
    			-- Does type of current object conform to type
    			-- of `other' (as per Eiffel: The Language, chapter 13)?
    			-- (from ANY)
    		require -- from ANY
    			other_not_void: other /= Void

    	connect_in_progress: BOOLEAN
    			-- Call to connect returned on a non-blocking socket.
    			-- (from SOCKET_RESOURCES)

    	connection_refused: BOOLEAN
    			-- Connection is refused (possibly due to security).
    			-- (from SOCKET_RESOURCES)

    	dtable_full: BOOLEAN
    			-- Descriptor table is full
    			-- (from SOCKET_RESOURCES)

    	error: STRING_8
    			-- Output a related error message.
    			-- (from SOCKET_RESOURCES)

    	error_number: INTEGER_32
    			-- Returned error number
    			-- (from SOCKET_RESOURCES)

    	expired_socket: BOOLEAN
    			-- Socket connection has expired.
    			-- (from SOCKET_RESOURCES)

    	has_exception_state: BOOLEAN
    			-- Is socket in exception state within timeout seconds?
    			-- (from NETWORK_SOCKET)

    	invalid_address: BOOLEAN
    			-- Address is not valid.
    			-- (from SOCKET_RESOURCES)

    	invalid_socket_handle: BOOLEAN
    			-- Socket descriptor is not valid.
    			-- (from SOCKET_RESOURCES)

    	is_plain_text: BOOLEAN
    			-- Is file reserved for text (character sequences)?
    			-- (from IO_MEDIUM)

    	is_valid_peer_address (addr: like address): BOOLEAN
    			-- Is `addr' a valid peer address?
    			-- (from NETWORK_SOCKET)
    		require -- from SOCKET
    			address_exists: addr /= Void

    	last_character: CHARACTER_8
    			-- Last character read by read_character
    			-- (from IO_MEDIUM)

    	last_double: REAL_64
    			-- Last double read by read_double
    			-- (from IO_MEDIUM)

    	last_integer: INTEGER_32
    			-- Last integer read by read_integer
    			-- (from IO_MEDIUM)

    	last_integer_16: INTEGER_16
    			-- Last 16-bit integer read by read_integer_16
    			-- (from IO_MEDIUM)

    	last_integer_32: INTEGER_32
    			-- Synonymy of last_integer
    			-- (from IO_MEDIUM)

    	last_integer_64: INTEGER_64
    			-- Last 64-bit integer read by read_integer_64
    			-- (from IO_MEDIUM)

    	last_integer_8: INTEGER_8
    			-- Last 8-bit integer read by read_integer_8
    			-- (from IO_MEDIUM)

    	last_natural: NATURAL_32
    			-- Last 32-bit natural read by read_natural
    			-- (from IO_MEDIUM)

    	last_natural_16: NATURAL_16
    			-- Last 16-bit natural read by read_natural_16
    			-- (from IO_MEDIUM)

    	last_natural_32: NATURAL_32
    			-- Synonymy of last_natural
    			-- (from IO_MEDIUM)

    	last_natural_64: NATURAL_64
    			-- Last 64-bit natural read by read_natural_64
    			-- (from IO_MEDIUM)

    	last_natural_8: NATURAL_8
    			-- Last 8-bit natural read by read_natural_8
    			-- (from IO_MEDIUM)

    	last_real: REAL_32
    			-- Last real read by read_real
    			-- (from IO_MEDIUM)

    	last_string: STRING_8
    			-- Last string read
    			-- (from IO_MEDIUM)

    	network: BOOLEAN
    			-- Socket failed due to network problems.
    			-- (from SOCKET_RESOURCES)

    	no_buffers: BOOLEAN
    			-- No more buffers available
    			-- (from SOCKET_RESOURCES)

    	no_permission: BOOLEAN
    			-- No permission is given to user for this socket.
    			-- (from SOCKET_RESOURCES)

    	not_connected: BOOLEAN
    			-- Socket is not connect.
    			-- (from SOCKET_RESOURCES)

    	port: INTEGER_32
    			-- Port socket is bound to.
    			-- (from NETWORK_SOCKET)
    		require -- from NETWORK_SOCKET
    			valid_socket: exists

    	protected_address: BOOLEAN
    			-- No access to this address is allowed.
    			-- (from SOCKET_RESOURCES)

    	protocol_not_supported: BOOLEAN
    			-- Protocol is not supported on this platform.
    			-- (from SOCKET_RESOURCES)

    	ready_for_reading: BOOLEAN
    			-- Is data available for reading from the socket within
    			-- timeout seconds?
    			-- (from NETWORK_SOCKET)

    	ready_for_writing: BOOLEAN
    			-- Can data be written to the socket within timeout seconds?
    			-- (from NETWORK_SOCKET)

    	reuse_address: BOOLEAN
    			-- Is reuse_address option set?
    			-- (from NETWORK_SOCKET)
    		require -- from NETWORK_SOCKET
    			socket_exists: exists

    	same_type (other: ANY): BOOLEAN
    			-- Is type of current object identical to type of `other'?
    			-- (from ANY)
    		require -- from ANY
    			other_not_void: other /= Void
    		ensure -- from ANY
    			definition: Result = (conforms_to (other) and other.conforms_to (Current))

    	socket_family_not_supported: BOOLEAN
    			-- Requested family is not supported.
    			-- (from SOCKET_RESOURCES)

    	socket_in_use: BOOLEAN
    			-- Socket is already in use.
    			-- (from SOCKET_RESOURCES)

    	socket_ok: BOOLEAN
    			-- No error
    			-- (from SOCKET_RESOURCES)

    	socket_would_block: BOOLEAN
    			-- Call to read, write, etc would have blocked.
    			-- (from SOCKET_RESOURCES)

    	support_storable: BOOLEAN
    			-- Can medium be used to store an Eiffel structure?
    			-- (from SOCKET)

    	timeout: INTEGER_32
    			-- Duration of timeout in seconds
    			-- (from NETWORK_SOCKET)

    	zero_option: BOOLEAN
    			-- No options provided
    			-- (from SOCKET_RESOURCES)

    feature -- Status setting

    	disable_broadcast
    			-- Disable broadcasting.
    		require
    			valid_descriptor: exists

    	do_not_reuse_address
    			-- Turn reuse_address option off.
    			-- (from NETWORK_SOCKET)
    		require -- from NETWORK_SOCKET
    			socket_exists: exists

    	enable_broadcast
    			-- Enable broadcasting.
    		require
    			valid_descriptor: exists

    	set_reuse_address
    			-- Turn reuse_address option on.
    			-- (from NETWORK_SOCKET)
    		require -- from NETWORK_SOCKET
    			socket_exists: exists

    	set_timeout (n: INTEGER_32)
    			-- Set timeout to `n' seconds.
    			-- (from NETWORK_SOCKET)
    		require -- from NETWORK_SOCKET
    			non_negative: n >= 0
    		ensure -- from NETWORK_SOCKET
    			timeout_set: timeout = n or timeout = default_timeout

    feature -- Element change

    	basic_store (object: ANY)
    			-- Produce an external representation of the
    			-- entire object structure reachable from `object'.
    			-- Retrievable within current system only.
    			-- (from SOCKET)
    		require -- from IO_MEDIUM
    			object_not_void: object /= Void
    			extendible: extendible
    			support_storable: support_storable
    		require else -- from SOCKET
    			socket_exists: exists
    			opened_for_write: is_open_write
    			support_storable: support_storable

    	general_store (object: ANY)
    			-- Produce an external representation of the
    			-- entire object structure reachable from `object'.
    			-- Retrievable from other systems for same platform
    			-- (machine architecture).
    			-- (from SOCKET)
    		require -- from IO_MEDIUM
    			object_not_void: object /= Void
    			extendible: extendible
    			support_storable: support_storable
    		require else -- from SOCKET
    			socket_exists: exists
    			opened_for_write: is_open_write
    			support_storable: support_storable

    	independent_store (object: ANY)
    			-- Produce an external representation of the
    			-- entire object structure reachable from `object'.
    			-- Retrievable from other systems for the same or other
    			-- platform (machine architecture).
    			-- (from SOCKET)
    		require -- from IO_MEDIUM
    			object_not_void: object /= Void
    			extendible: extendible
    			support_storable: support_storable
    		require else -- from SOCKET
    			socket_exists: exists
    			opened_for_write: is_open_write
    			support_storable: support_storable

    feature -- Removal

    	dispose
    			-- Ensure this medium is closed when garbage collected.
    			-- (from IO_MEDIUM)

    feature -- Duplication

    	copy (other: like Current)
    			-- Update current object using fields of object attached
    			-- to `other', so as to yield equal objects.
    			-- (from ANY)
    		require -- from ANY
    			other_not_void: other /= Void
    			type_identity: same_type (other)
    		ensure -- from ANY
    			is_equal: is_equal (other)

    	frozen deep_copy (other: like Current)
    			-- Effect equivalent to that of:
    			--		copy (`other' . deep_twin)
    			-- (from ANY)
    		require -- from ANY
    			other_not_void: other /= Void
    		ensure -- from ANY
    			deep_equal: deep_equal (Current, other)

    	frozen deep_twin: like Current
    			-- New object structure recursively duplicated from Current.
    			-- (from ANY)
    		ensure -- from ANY
    			deep_equal: deep_equal (Current, Result)

    	frozen standard_copy (other: like Current)
    			-- Copy every field of `other' onto corresponding field
    			-- of current object.
    			-- (from ANY)
    		require -- from ANY
    			other_not_void: other /= Void
    			type_identity: same_type (other)
    		ensure -- from ANY
    			is_standard_equal: standard_is_equal (other)

    	frozen standard_twin: like Current
    			-- New object field-by-field identical to `other'.
    			-- Always uses default copying semantics.
    			-- (from ANY)
    		ensure -- from ANY
    			standard_twin_not_void: Result /= Void
    			equal: standard_equal (Result, Current)

    	frozen twin: like Current
    			-- New object equal to `Current'
    			-- twin calls copy; to change copying/twining semantics, redefine copy.
    			-- (from ANY)
    		ensure -- from ANY
    			twin_not_void: Result /= Void
    			is_equal: Result.is_equal (Current)

    feature -- Miscellaneous

    	make_peer_address
    			-- Create peer address.
    		ensure -- from DATAGRAM_SOCKET
    			peer_created: peer_address /= Void

    	name: STRING_8
    			-- Socket name
    			-- (from SOCKET)
    		require -- from  IO_MEDIUM
    			True
    		require else -- from SOCKET
    			socket_exists: exists

    	target_to_hostname (a_hostname: STRING_8; a_peer_port: INTEGER_32)
    			-- Connect socket to address provided by
    			-- hostname `a_hostname' and port `a_port'.
    		require
    			socket_exists: exists

    	target_to_ip (an_ip_number: STRING_8; a_peer_port: INTEGER_32)
    			-- Connect socket to address provided by
    			-- hostname `a_hostname' and port `a_port'.
    		require
    			socket_exists: exists

    feature -- Basic operations

    	bind
    			-- Bind socket to a local address.
    			-- (from DATAGRAM_SOCKET)

    	close
    			-- Close socket.
    			-- (from DATAGRAM_SOCKET)

    	connect_to_peer (a_peer_address: like address)
    			-- Target socket to `a_peer_address'.
    			-- (from DATAGRAM_SOCKET)
    		require -- from DATAGRAM_SOCKET
    			socket_exists: exists

    	frozen default: like Current
    			-- Default value of object's type
    			-- (from ANY)

    	frozen default_pointer: POINTER
    			-- Default value of type `POINTER'
    			-- (Avoid the need to write `p'.default for
    			-- some `p' of type `POINTER'.)
    			-- (from ANY)

    	default_rescue
    			-- Process exception for routines with no Rescue clause.
    			-- (Default: do nothing.)
    			-- (from ANY)

    	frozen do_nothing
    			-- Execute a null action.
    			-- (from ANY)

    feature -- Obsolete

    	lastchar: CHARACTER_8
    			-- Last character read by read_character
    			-- (from IO_MEDIUM)

    	lastdouble: REAL_64
    			-- Last double read by read_double
    			-- (from IO_MEDIUM)

    	lastint: INTEGER_32
    			-- Last integer read by read_integer
    			-- (from IO_MEDIUM)

    	lastreal: REAL_32
    			-- Last real read by read_real
    			-- (from IO_MEDIUM)

    	laststring: STRING_8
    			-- Last string read
    			-- (from IO_MEDIUM)

    feature -- Basic commands

    	socket_address: SOCKET_ADDRESS
    			-- Local address of socket
    			-- (from SOCKET)

    	socket_bind
    			-- Bind socket to local address in address.
    			-- (from SOCKET)
    		require -- from SOCKET
    			socket_exists: exists
    			valid_local_address: address /= Void

    	cleanup
    			-- Cleanup socket.
    			-- (from SOCKET)

    	socket_close
    			-- Close socket for all context.
    			-- (from SOCKET)
    		require -- from IO_MEDIUM
    			medium_is_open: not is_closed
    		require else -- from SOCKET
    			socket_exists: exists

    	close_socket
    			-- Close socket for current context.
    			-- (from SOCKET)
    		require -- from SOCKET
    			socket_exists: exists
    			is_open: is_open_read or is_open_write
    		ensure -- from SOCKET
    			is_closed: is_closed
    			not_is_open: not is_open_read and not is_open_write

    	connect
    			-- Connect socket to peer address.
    			-- (from SOCKET)
    		require -- from SOCKET
    			socket_exists: exists
    			valid_peer_address: peer_address /= Void

    	descriptor: INTEGER_32
    			-- Socket descriptor of current socket
    			-- (from SOCKET)

    	descriptor_available: BOOLEAN
    			-- Is descriptor available?
    			-- (from SOCKET)

    	family: INTEGER_32
    			-- Socket family eg. af_inet, af_unix
    			-- (from SOCKET)

    	is_closed: BOOLEAN
    			-- Is socket closed?
    			-- (from SOCKET)

    	make_socket
    			-- Create socket descriptor.
    			-- (from SOCKET)
    		require -- from SOCKET
    			valid_family: family >= 0
    			valid_type: type >= 0
    			valid_protocol: protocol >= 0

    	peer_address: like address
    			-- Peer address of socket
    			-- (from SOCKET)

    	protocol: INTEGER_32
    			-- Protocol of the socket. default 0
    			-- means for the system to chose the default
    			-- protocol for the family chosen. eg. `udp', `tcp'.
    			-- (from SOCKET)

    	set_address (addr: like address)
    			-- Set local address to `addr'.
    			-- (from SOCKET)
    		require -- from SOCKET
    			same_type: addr.family = family
    		ensure -- from SOCKET
    			address_set: address = addr

    	socket_set_peer_address (addr: like address)
    			-- Set peer address to `addr'.
    			-- (from SOCKET)
    		require -- from SOCKET
    			address_exists: addr /= Void
    			address_valid: is_valid_peer_address (addr)
    		ensure -- from SOCKET
    			address_set: peer_address = addr

    	set_peer_address (addr: like address)
    			-- Set peer address to `addr'.
    			-- (from SOCKET)
    		require -- from SOCKET
    			address_exists: addr /= Void
    			address_valid: is_valid_peer_address (addr)
    		ensure -- from SOCKET
    			address_set: peer_address = addr

    	type: INTEGER_32
    			-- Type of socket. eg stream, datagram
    			-- (from SOCKET)

    feature -- Creation

    	make_bound_to_address (a_local_address: like address)
    			-- Create a socket bound to its well-known address
    			-- `local_address'.
    			-- (from DATAGRAM_SOCKET)

    	make_connected_to_peer (a_peer_address: like address)
    			-- Create a socket targeted to peer_address.
    			-- (from DATAGRAM_SOCKET)

    feature -- Externals: flags for send, sendto recv and recvfrom socket calls

    	c_msgdontroute: INTEGER_32
    			-- Do not route message
    			-- (from SOCKET_RESOURCES)

    	c_oobmsg: INTEGER_32
    			-- Out of bound message
    			-- (from SOCKET_RESOURCES)

    	c_peekmsg: INTEGER_32
    			-- Peek message
    			-- (from SOCKET_RESOURCES)

    feature -- Input

    	last_boolean: BOOLEAN
    			-- Last boolean read by read_boolean
    			-- (from SOCKET)

    	read (size: INTEGER_32): PACKET
    			-- Read a packet of data of maximum size `size'.
    			-- (from SOCKET)
    		require -- from SOCKET
    			socket_exists: exists
    			opened_for_read: is_open_read

    	read_boolean
    			-- Read a new boolean.
    			-- Maker result available in last_boolean.
    			-- Was declared in SOCKET as synonym of readbool.
    			-- (from SOCKET)
    		require else -- from SOCKET
    			socket_exists: exists
    			opened_for_read: is_open_read

    	read_character
    			-- Read a new character.
    			-- Make result available in last_character.
    			-- Was declared in SOCKET as synonym of readchar.
    			-- (from SOCKET)
    		require -- from IO_MEDIUM
    			is_readable: readable
    		require else -- from SOCKET
    			socket_exists: exists
    			opened_for_read: is_open_read

    	read_double
    			-- Read a new double.
    			-- Make result available in last_double.
    			-- Was declared in SOCKET as synonym of readdouble.
    			-- (from SOCKET)
    		require -- from IO_MEDIUM
    			is_readable: readable
    		require else -- from SOCKET
    			socket_exists: exists
    			opened_for_read: is_open_read

    	read_integer
    			-- Read a new 32-bit integer.
    			-- Make result available in last_integer.
    			-- Was declared in SOCKET as synonym of readint and read_integer_32.
    			-- (from SOCKET)
    		require -- from IO_MEDIUM
    			is_readable: readable
    		require else -- from SOCKET
    			socket_exists: exists
    			opened_for_read: is_open_read

    	read_integer_16
    			-- Read a new 16-bit integer.
    			-- Make result available in last_integer_16.
    			-- (from SOCKET)
    		require -- from IO_MEDIUM
    			is_readable: readable
    		require else -- from SOCKET
    			socket_exists: exists
    			opened_for_read: is_open_read

    	read_integer_32
    			-- Read a new 32-bit integer.
    			-- Make result available in last_integer.
    			-- Was declared in SOCKET as synonym of read_integer and readint.
    			-- (from SOCKET)
    		require -- from IO_MEDIUM
    			is_readable: readable
    		require else -- from SOCKET
    			socket_exists: exists
    			opened_for_read: is_open_read

    	read_integer_64
    			-- Read a new 64-bit integer.
    			-- Make result available in last_integer_64.
    			-- (from SOCKET)
    		require -- from IO_MEDIUM
    			is_readable: readable
    		require else -- from SOCKET
    			socket_exists: exists
    			opened_for_read: is_open_read

    	read_integer_8
    			-- Read a new 8-bit integer.
    			-- Make result available in last_integer_8.
    			-- (from SOCKET)
    		require -- from IO_MEDIUM
    			is_readable: readable
    		require else -- from SOCKET
    			socket_exists: exists
    			opened_for_read: is_open_read

    	read_line
    			-- Read a line of characters (ended by a new_line).
    			-- Was declared in SOCKET as synonym of readline.
    			-- (from SOCKET)
    		require -- from IO_MEDIUM
    			is_readable: readable
    		require else -- from SOCKET
    			socket_exists: exists
    			opened_for_read: is_open_read
    		ensure -- from IO_MEDIUM
    			last_string_not_void: last_string /= Void

    	read_natural
    			-- Read a new 32-bit natural.
    			-- Make result available in last_natural.
    			-- Was declared in SOCKET as synonym of read_natural_32.
    			-- (from SOCKET)
    		require -- from IO_MEDIUM
    			is_readable: readable
    		require else -- from SOCKET
    			socket_exists: exists
    			opened_for_read: is_open_read

    	read_natural_16
    			-- Read a new 16-bit natural.
    			-- Make result available in last_natural_16.
    			-- (from SOCKET)
    		require -- from IO_MEDIUM
    			is_readable: readable
    		require else -- from SOCKET
    			socket_exists: exists
    			opened_for_read: is_open_read

    	read_natural_32
    			-- Read a new 32-bit natural.
    			-- Make result available in last_natural.
    			-- Was declared in SOCKET as synonym of read_natural.
    			-- (from SOCKET)
    		require -- from IO_MEDIUM
    			is_readable: readable
    		require else -- from SOCKET
    			socket_exists: exists
    			opened_for_read: is_open_read

    	read_natural_64
    			-- Read a new 64-bit natural.
    			-- Make result available in last_natural_64.
    			-- (from SOCKET)
    		require -- from IO_MEDIUM
    			is_readable: readable
    		require else -- from SOCKET
    			socket_exists: exists
    			opened_for_read: is_open_read

    	read_natural_8
    			-- Read a new 8-bit natural.
    			-- Make result available in last_natural_8.
    			-- (from SOCKET)
    		require -- from IO_MEDIUM
    			is_readable: readable
    		require else -- from SOCKET
    			socket_exists: exists
    			opened_for_read: is_open_read

    	read_real
    			-- Read a new real.
    			-- Make result available in last_real.
    			-- Was declared in SOCKET as synonym of readreal.
    			-- (from SOCKET)
    		require -- from IO_MEDIUM
    			is_readable: readable
    		require else -- from SOCKET
    			socket_exists: exists
    			opened_for_read: is_open_read

    	read_stream (nb_char: INTEGER_32)
    			-- Read a string of at most `nb_char' characters.
    			-- Make result available in last_string.
    			-- Was declared in SOCKET as synonym of readstream.
    			-- (from SOCKET)
    		require -- from IO_MEDIUM
    			is_readable: readable
    		require else -- from SOCKET
    			socket_exists: exists
    			opened_for_read: is_open_read
    		ensure -- from IO_MEDIUM
    			last_string_not_void: last_string /= Void

    	read_to_managed_pointer (p: MANAGED_POINTER; start_pos, nb_bytes: INTEGER_32)
    			-- Read at most `nb_bytes' bound bytes and make result
    			-- available in `p' at position `start_pos'.
    			-- (from SOCKET)
    		require -- from IO_MEDIUM
    			p_not_void: p /= Void
    			p_large_enough: p.count >= nb_bytes + start_pos
    			nb_bytes_non_negative: nb_bytes >= 0
    			is_readable: readable
    		require else -- from SOCKET
    			p_not_void: p /= Void
    			p_large_enough: p.count >= nb_bytes + start_pos
    			nb_bytes_non_negative: nb_bytes >= 0
    			socket_exists: exists
    			opened_for_read: is_open_read
    		ensure -- from IO_MEDIUM
    			bytes_read_non_negative: bytes_read >= 0
    			bytes_read_not_too_big: bytes_read <= nb_bytes

    	readbool
    			-- Read a new boolean.
    			-- Maker result available in last_boolean.
    			-- Was declared in SOCKET as synonym of read_boolean.
    			-- (from SOCKET)
    		require else -- from SOCKET
    			socket_exists: exists
    			opened_for_read: is_open_read

    	readchar
    			-- Read a new character.
    			-- Make result available in last_character.
    			-- Was declared in SOCKET as synonym of read_character.
    			-- (from SOCKET)
    		require -- from IO_MEDIUM
    			is_readable: readable
    		require else -- from SOCKET
    			socket_exists: exists
    			opened_for_read: is_open_read

    	readdouble
    			-- Read a new double.
    			-- Make result available in last_double.
    			-- Was declared in SOCKET as synonym of read_double.
    			-- (from SOCKET)
    		require -- from IO_MEDIUM
    			is_readable: readable
    		require else -- from SOCKET
    			socket_exists: exists
    			opened_for_read: is_open_read

    	readint
    			-- Read a new 32-bit integer.
    			-- Make result available in last_integer.
    			-- Was declared in SOCKET as synonym of read_integer and read_integer_32.
    			-- (from SOCKET)
    		require -- from IO_MEDIUM
    			is_readable: readable
    		require else -- from SOCKET
    			socket_exists: exists
    			opened_for_read: is_open_read

    	readline
    			-- Read a line of characters (ended by a new_line).
    			-- Was declared in SOCKET as synonym of read_line.
    			-- (from SOCKET)
    		require -- from IO_MEDIUM
    			is_readable: readable
    		require else -- from SOCKET
    			socket_exists: exists
    			opened_for_read: is_open_read
    		ensure -- from IO_MEDIUM
    			last_string_not_void: last_string /= Void

    	readreal
    			-- Read a new real.
    			-- Make result available in last_real.
    			-- Was declared in SOCKET as synonym of read_real.
    			-- (from SOCKET)
    		require -- from IO_MEDIUM
    			is_readable: readable
    		require else -- from SOCKET
    			socket_exists: exists
    			opened_for_read: is_open_read

    	readstream (nb_char: INTEGER_32)
    			-- Read a string of at most `nb_char' characters.
    			-- Make result available in last_string.
    			-- Was declared in SOCKET as synonym of read_stream.
    			-- (from SOCKET)
    		require -- from IO_MEDIUM
    			is_readable: readable
    		require else -- from SOCKET
    			socket_exists: exists
    			opened_for_read: is_open_read
    		ensure -- from IO_MEDIUM
    			last_string_not_void: last_string /= Void

    	receive (size, flags: INTEGER_32): PACKET
    			-- Receive a packet of maximum size `size'.
    			-- (from SOCKET)
    		require -- from SOCKET
    			socket_exists: exists
    			opened_for_read: is_open_read

    	received (size: INTEGER_32; flags: INTEGER_32): DATAGRAM_PACKET
    			-- Receive a packet.
    			-- Who from is put into the peer_address.
    			-- (from DATAGRAM_SOCKET)
    		require -- from DATAGRAM_SOCKET
    			socket_exists: exists
    			opened_for_read: is_open_read
    		ensure -- from DATAGRAM_SOCKET
    			known_address: peer_address /= Void

    feature -- Output

    	exists: BOOLEAN
    			-- Does socket exist?
    			-- (from SOCKET)

    	extendible: BOOLEAN
    			-- May new items be added?
    			-- (from SOCKET)

    	io: STD_FILES
    			-- Handle to standard file setup
    			-- (from ANY)

    	is_executable: BOOLEAN
    			-- Is socket an executable?
    			-- (from SOCKET)
    		require -- from IO_MEDIUM
    			handle_exists: exists

    	is_open_read: BOOLEAN
    			-- Is socket opened for reading?
    			-- (from SOCKET)

    	is_open_write: BOOLEAN
    			-- Is socket opened for writing?
    			-- (from SOCKET)

    	is_readable: BOOLEAN
    			-- Is socket a readable medium?
    			-- (from SOCKET)
    		require -- from IO_MEDIUM
    			handle_exists: exists

    	is_writable: BOOLEAN
    			-- Is socket a writable medium?
    			-- (from SOCKET)
    		require -- from IO_MEDIUM
    			handle_exists: exists

    	new_line
    			-- Write a "new_line" character to socket.
    			-- Was declared in SOCKET as synonym of put_new_line.
    			-- (from SOCKET)
    		require -- from IO_MEDIUM
    			extendible: extendible
    		require else -- from SOCKET
    			socket_exists: exists
    			opened_for_write: is_open_write

    	out: STRING_8
    			-- New string containing terse printable representation
    			-- of current object
    			-- Was declared in ANY as synonym of tagged_out.
    			-- (from ANY)

    	print (some: ANY)
    			-- Write terse external representation of `some'
    			-- on standard output.
    			-- (from ANY)

    	put_boolean (b: BOOLEAN)
    			-- Send boolean `b' through socket.
    			-- Was declared in DATAGRAM_SOCKET as synonym of putbool.
    			-- (from DATAGRAM_SOCKET)
    		require -- from IO_MEDIUM
    			extendible: extendible
    		require else -- from SOCKET
    			socket_exists: exists
    			opened_for_write: is_open_write
    		require else -- from DATAGRAM_SOCKET
    			socket_exists: exists
    			opened_for_write: is_open_write
    			valid_peer: peer_address /= Void

    	put_character (c: CHARACTER_8)
    			-- Send character `c' through socket.
    			-- Was declared in DATAGRAM_SOCKET as synonym of putchar.
    			-- (from DATAGRAM_SOCKET)
    		require -- from IO_MEDIUM
    			extendible: extendible
    		require else -- from SOCKET
    			socket_exists: exists
    			opened_for_write: is_open_write
    		require else -- from DATAGRAM_SOCKET
    			socket_exists: exists
    			opened_for_write: is_open_write
    			valid_peer: peer_address /= Void

    	put_double (d: REAL_64)
    			-- Send double `d' through socket.
    			-- Was declared in DATAGRAM_SOCKET as synonym of putdouble.
    			-- (from DATAGRAM_SOCKET)
    		require -- from IO_MEDIUM
    			extendible: extendible
    		require else -- from SOCKET
    			socket_exists: exists
    			opened_for_write: is_open_write
    		require else -- from DATAGRAM_SOCKET
    			socket_exists: exists
    			opened_for_write: is_open_write
    			valid_peer: peer_address /= Void

    	put_integer (i: INTEGER_32)
    			-- Send integer `i' through socket.
    			-- Was declared in DATAGRAM_SOCKET as synonym of putint and put_integer_32.
    			-- (from DATAGRAM_SOCKET)
    		require -- from IO_MEDIUM
    			extendible: extendible
    		require else -- from SOCKET
    			socket_exists: exists
    			opened_for_write: is_open_write
    		require else -- from DATAGRAM_SOCKET
    			socket_exists: exists
    			opened_for_write: is_open_write
    			valid_peer: peer_address /= Void

    	put_integer_16 (i: INTEGER_16)
    			-- Send integer `i' through socket.
    			-- (from DATAGRAM_SOCKET)
    		require -- from IO_MEDIUM
    			extendible: extendible
    		require else -- from SOCKET
    			socket_exists: exists
    			opened_for_write: is_open_write
    		require else -- from DATAGRAM_SOCKET
    			socket_exists: exists
    			opened_for_write: is_open_write
    			valid_peer: peer_address /= Void

    	put_integer_32 (i: INTEGER_32)
    			-- Send integer `i' through socket.
    			-- Was declared in DATAGRAM_SOCKET as synonym of put_integer and putint.
    			-- (from DATAGRAM_SOCKET)
    		require -- from IO_MEDIUM
    			extendible: extendible
    		require else -- from SOCKET
    			socket_exists: exists
    			opened_for_write: is_open_write
    		require else -- from DATAGRAM_SOCKET
    			socket_exists: exists
    			opened_for_write: is_open_write
    			valid_peer: peer_address /= Void

    	put_integer_64 (i: INTEGER_64)
    			-- Send integer `i' through socket.
    			-- (from DATAGRAM_SOCKET)
    		require -- from IO_MEDIUM
    			extendible: extendible
    		require else -- from SOCKET
    			socket_exists: exists
    			opened_for_write: is_open_write
    		require else -- from DATAGRAM_SOCKET
    			socket_exists: exists
    			opened_for_write: is_open_write
    			valid_peer: peer_address /= Void

    	put_integer_8 (i: INTEGER_8)
    			-- Send integer `i' through socket.
    			-- (from DATAGRAM_SOCKET)
    		require -- from IO_MEDIUM
    			extendible: extendible
    		require else -- from SOCKET
    			socket_exists: exists
    			opened_for_write: is_open_write
    		require else -- from DATAGRAM_SOCKET
    			socket_exists: exists
    			opened_for_write: is_open_write
    			valid_peer: peer_address /= Void

    	put_managed_pointer (p: MANAGED_POINTER; start_pos, nb_bytes: INTEGER_32)
    			-- Put data of length `nb_bytes' pointed by `start_pos' index in `p' at
    			-- current position.
    			-- (from DATAGRAM_SOCKET)
    		require -- from IO_MEDIUM
    			p_not_void: p /= Void
    			p_large_enough: p.count >= nb_bytes + start_pos
    			nb_bytes_non_negative: nb_bytes >= 0
    			extendible: extendible
    		require else -- from SOCKET
    			p_not_void: p /= Void
    			p_large_enough: p.count >= nb_bytes + start_pos
    			nb_bytes_non_negative: nb_bytes >= 0
    			socket_exists: exists
    			opened_for_write: is_open_write
    		require else -- from DATAGRAM_SOCKET
    			p_not_void: p /= Void
    			p_large_enough: p.count >= nb_bytes + start_pos
    			socket_exists: exists
    			opened_for_write: is_open_write
    			valid_peer: peer_address /= Void

    	put_natural (i: NATURAL_32)
    			-- Send integer `i' through socket.
    			-- Was declared in DATAGRAM_SOCKET as synonym of put_natural_32.
    			-- (from DATAGRAM_SOCKET)
    		require -- from IO_MEDIUM
    			extendible: extendible
    		require else -- from SOCKET
    			socket_exists: exists
    			opened_for_write: is_open_write
    		require else -- from DATAGRAM_SOCKET
    			socket_exists: exists
    			opened_for_write: is_open_write
    			valid_peer: peer_address /= Void

    	put_natural_16 (i: NATURAL_16)
    			-- Send integer `i' through socket.
    			-- (from DATAGRAM_SOCKET)
    		require -- from IO_MEDIUM
    			extendible: extendible
    		require else -- from SOCKET
    			socket_exists: exists
    			opened_for_write: is_open_write
    		require else -- from DATAGRAM_SOCKET
    			socket_exists: exists
    			opened_for_write: is_open_write
    			valid_peer: peer_address /= Void

    	put_natural_32 (i: NATURAL_32)
    			-- Send integer `i' through socket.
    			-- Was declared in DATAGRAM_SOCKET as synonym of put_natural.
    			-- (from DATAGRAM_SOCKET)
    		require -- from IO_MEDIUM
    			extendible: extendible
    		require else -- from SOCKET
    			socket_exists: exists
    			opened_for_write: is_open_write
    		require else -- from DATAGRAM_SOCKET
    			socket_exists: exists
    			opened_for_write: is_open_write
    			valid_peer: peer_address /= Void

    	put_natural_64 (i: NATURAL_64)
    			-- Send integer `i' through socket.
    			-- (from DATAGRAM_SOCKET)
    		require -- from IO_MEDIUM
    			extendible: extendible
    		require else -- from SOCKET
    			socket_exists: exists
    			opened_for_write: is_open_write
    		require else -- from DATAGRAM_SOCKET
    			socket_exists: exists
    			opened_for_write: is_open_write
    			valid_peer: peer_address /= Void

    	put_natural_8 (i: NATURAL_8)
    			-- Send integer `i' through socket.
    			-- (from DATAGRAM_SOCKET)
    		require -- from IO_MEDIUM
    			extendible: extendible
    		require else -- from SOCKET
    			socket_exists: exists
    			opened_for_write: is_open_write
    		require else -- from DATAGRAM_SOCKET
    			socket_exists: exists
    			opened_for_write: is_open_write
    			valid_peer: peer_address /= Void

    	put_new_line
    			-- Write a "new_line" character to socket.
    			-- Was declared in SOCKET as synonym of new_line.
    			-- (from SOCKET)
    		require -- from IO_MEDIUM
    			extendible: extendible
    		require else -- from SOCKET
    			socket_exists: exists
    			opened_for_write: is_open_write

    	put_real (r: REAL_32)
    			-- Send real `r' through socket.
    			-- Was declared in DATAGRAM_SOCKET as synonym of putreal.
    			-- (from DATAGRAM_SOCKET)
    		require -- from IO_MEDIUM
    			extendible: extendible
    		require else -- from SOCKET
    			socket_exists: exists
    			opened_for_write: is_open_write
    		require else -- from DATAGRAM_SOCKET
    			socket_exists: exists
    			opened_for_write: is_open_write
    			valid_peer: peer_address /= Void

    	put_string (s: STRING_8)
    			-- Send string `s' through socket.
    			-- Was declared in DATAGRAM_SOCKET as synonym of putstring.
    			-- (from DATAGRAM_SOCKET)
    		require -- from IO_MEDIUM
    			extendible: extendible
    			non_void: s /= Void
    		require else -- from SOCKET
    			socket_exists: exists
    			opened_for_write: is_open_write
    		require else -- from DATAGRAM_SOCKET
    			socket_exists: exists
    			opened_for_write: is_open_write
    			valid_peer: peer_address /= Void

    	putbool (b: BOOLEAN)
    			-- Send boolean `b' through socket.
    			-- Was declared in DATAGRAM_SOCKET as synonym of put_boolean.
    			-- (from DATAGRAM_SOCKET)
    		require -- from IO_MEDIUM
    			extendible: extendible
    		require else -- from SOCKET
    			socket_exists: exists
    			opened_for_write: is_open_write
    		require else -- from DATAGRAM_SOCKET
    			socket_exists: exists
    			opened_for_write: is_open_write
    			valid_peer: peer_address /= Void

    	putchar (c: CHARACTER_8)
    			-- Send character `c' through socket.
    			-- Was declared in DATAGRAM_SOCKET as synonym of put_character.
    			-- (from DATAGRAM_SOCKET)
    		require -- from IO_MEDIUM
    			extendible: extendible
    		require else -- from SOCKET
    			socket_exists: exists
    			opened_for_write: is_open_write
    		require else -- from DATAGRAM_SOCKET
    			socket_exists: exists
    			opened_for_write: is_open_write
    			valid_peer: peer_address /= Void

    	putdouble (d: REAL_64)
    			-- Send double `d' through socket.
    			-- Was declared in DATAGRAM_SOCKET as synonym of put_double.
    			-- (from DATAGRAM_SOCKET)
    		require -- from IO_MEDIUM
    			extendible: extendible
    		require else -- from SOCKET
    			socket_exists: exists
    			opened_for_write: is_open_write
    		require else -- from DATAGRAM_SOCKET
    			socket_exists: exists
    			opened_for_write: is_open_write
    			valid_peer: peer_address /= Void

    	putint (i: INTEGER_32)
    			-- Send integer `i' through socket.
    			-- Was declared in DATAGRAM_SOCKET as synonym of put_integer and put_integer_32.
    			-- (from DATAGRAM_SOCKET)
    		require -- from IO_MEDIUM
    			extendible: extendible
    		require else -- from SOCKET
    			socket_exists: exists
    			opened_for_write: is_open_write
    		require else -- from DATAGRAM_SOCKET
    			socket_exists: exists
    			opened_for_write: is_open_write
    			valid_peer: peer_address /= Void

    	putreal (r: REAL_32)
    			-- Send real `r' through socket.
    			-- Was declared in DATAGRAM_SOCKET as synonym of put_real.
    			-- (from DATAGRAM_SOCKET)
    		require -- from IO_MEDIUM
    			extendible: extendible
    		require else -- from SOCKET
    			socket_exists: exists
    			opened_for_write: is_open_write
    		require else -- from DATAGRAM_SOCKET
    			socket_exists: exists
    			opened_for_write: is_open_write
    			valid_peer: peer_address /= Void

    	putstring (s: STRING_8)
    			-- Send string `s' through socket.
    			-- Was declared in DATAGRAM_SOCKET as synonym of put_string.
    			-- (from DATAGRAM_SOCKET)
    		require -- from IO_MEDIUM
    			extendible: extendible
    			non_void: s /= Void
    		require else -- from SOCKET
    			socket_exists: exists
    			opened_for_write: is_open_write
    		require else -- from DATAGRAM_SOCKET
    			socket_exists: exists
    			opened_for_write: is_open_write
    			valid_peer: peer_address /= Void

    	readable: BOOLEAN
    			-- Is there currently any data available on socket?
    			-- (from SOCKET)
    		require -- from IO_MEDIUM
    			handle_exists: exists

    	send (a_packet: PACKET; flags: INTEGER_32)
    			-- Send `a_packet' to address in peer_address.
    			-- (from DATAGRAM_SOCKET)
    		require -- from SOCKET
    			socket_exists: exists
    			opened_for_write: is_open_write
    			valid_packet: a_packet /= Void

    	send_to (a_packet: DATAGRAM_PACKET; to_address: SOCKET_ADDRESS; flags: INTEGER_32)
    			-- Send `a_packet' to address `to_address'
    			-- (from DATAGRAM_SOCKET)
    		require -- from DATAGRAM_SOCKET
    			socket_exists: exists
    			opened_for_write: is_open_write
    			valid_peer: to_address /= Void
    			valid_packet: a_packet /= Void

    	frozen tagged_out: STRING_8
    			-- New string containing terse printable representation
    			-- of current object
    			-- Was declared in ANY as synonym of out.
    			-- (from ANY)

    	write (a_packet: PACKET)
    			-- Write packet `a_packet' to socket.
    			-- (from SOCKET)
    		require -- from SOCKET
    			socket_exists: exists
    			opened_for_write: is_open_write

    feature -- Platform

    	operating_environment: OPERATING_ENVIRONMENT
    			-- Objects available from the operating system
    			-- (from ANY)

    feature -- socket options

    	debug_enabled: BOOLEAN
    			-- Is socket system debugging enabled?
    			-- (from SOCKET)
    		require -- from SOCKET
    			socket_exists: exists

    	disable_debug
    			-- Disable socket system debugging.
    			-- (from SOCKET)
    		require -- from SOCKET
    			socket_exists: exists

    	do_not_route
    			-- Set socket to non-routing.
    			-- (from SOCKET)
    		require -- from SOCKET
    			socket_exists: exists

    	enable_debug
    			-- Enable socket system debugging.
    			-- (from SOCKET)
    		require -- from SOCKET
    			socket_exists: exists

    	group_id: INTEGER_32
    			-- Group id of socket
    			-- (from SOCKET)
    		require -- from SOCKET
    			socket_exists: exists
    			group_set: is_group_id

    	is_blocking: BOOLEAN
    			-- Is the socket blocking?
    			-- (from SOCKET)

    	is_group_id: BOOLEAN
    			-- Is the owner id the socket group id?
    			-- (from SOCKET)
    		require -- from SOCKET
    			socket_exists: exists

    	is_process_id: BOOLEAN
    			-- Is the owner id the socket process id?
    			-- (from SOCKET)
    		require -- from SOCKET
    			socket_exists: exists

    	is_socket_stream: BOOLEAN
    			-- Is the socket a stream?
    			-- (from SOCKET)
    		require -- from SOCKET
    			socket_exists: exists

    	process_id: INTEGER_32
    			-- Process id of socket
    			-- (from SOCKET)
    		require -- from SOCKET
    			socket_exists: exists
    			process_set: is_process_id

    	receive_buf_size: INTEGER_32
    			-- Size of receive buffer.
    			-- (from SOCKET)
    		require -- from SOCKET
    			socket_exists: exists

    	route
    			-- Set socket to routing.
    			-- (from SOCKET)
    		require -- from SOCKET
    			socket_exists: exists

    	route_enabled: BOOLEAN
    			-- Is routing enabled?
    			-- (from SOCKET)
    		require -- from SOCKET
    			socket_exists: exists

    	send_buf_size: INTEGER_32
    			-- Size of send buffer.
    			-- (from SOCKET)
    		require -- from SOCKET
    			socket_exists: exists

    	set_blocking
    			-- Set socket to blocking mode.
    			-- (from SOCKET)
    		require -- from SOCKET
    			socket_exists: exists
    		ensure -- from SOCKET
    			is_blocking

    	set_non_blocking
    			-- Set socket to non-blocking mode.
    			-- (from SOCKET)
    		require -- from SOCKET
    			socket_exists: exists
    		ensure -- from SOCKET
    			not is_blocking

    	set_owner (own: INTEGER_32)
    			-- Negative value sets group process id.
    			-- positive value sets process id.
    			-- (from SOCKET)
    		require -- from SOCKET
    			socket_exists: exists
    			valid_owner: own /= 0 and own /= -1
    		ensure -- from SOCKET
    			set_id: own < -1 implies own = group_id or else own > 0 implies own = process_id

    	set_receive_buf_size (s: INTEGER_32)
    			-- Set receive buffer size.
    			-- (from SOCKET)
    		require -- from SOCKET
    			socket_exists: exists
    		ensure -- from SOCKET
    			size_set: s = receive_buf_size

    	set_send_buf_size (s: INTEGER_32)
    			-- Set the send buffer to size `s'.
    			-- (from SOCKET)
    		require -- from SOCKET
    			socket_exists: exists
    		ensure -- from SOCKET
    			size_set: s = send_buf_size

    invariant
    		-- from NETWORK_SOCKET
    	timeout_set: timeout > 0

    		-- from ANY
    	reflexive_equality: standard_is_equal (Current)
    	reflexive_conformance: conforms_to (Current)

    indexing
    	copyright: "Copyright (c) 1984-2006, Eiffel Software and others"
    	license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
    	source: "[
    		Eiffel Software
    		356 Storke Road, Goleta, CA 93117 USA
    		Telephone 805-685-1006, Fax 805-685-6869
    		Website http://www.eiffel.com
    		Customer support http://support.eiffel.com
    	]"

    end -- class NETWORK_DATAGRAM_SOCKET