Eiffel Media API
Overview Cluster Class Classes Index      Previous Next      Top Features

em.network

Class EM_NETWORK_HELPER_FUNCTIONS


Direct ancestors

EM_NETWORK_CONSTANTS

Known direct descendants

EM_TCP_CLIENT_SOCKET, EM_INET_SOCKET_ADDRESS, EM_INET_ADDRESS, EM_NET_PROTOCOL, EM_NET_UNSERIALIZER, EM_NET_SERIALIZER

Features

Invariants

indexing

description

Common network helper functions.
This class may be used as ancestor by classes needing its facilities.

date

$Date: 2005/10/23 09:58:45 $

revision

$Revision: 1.19 $

class

EM_NETWORK_HELPER_FUNCTIONS

inherit

EM_NETWORK_CONSTANTS

feature -- Access

cr: INTEGER

-- Carriage return character code

-- (From EM_NETWORK_CONSTANTS)

in_addr_any: INTEGER

-- Used for listening on all network interfaces

-- (From EM_NETWORK_CONSTANTS)

in_addr_broadcast: INTEGER

-- Used as destination when sending a message to all clients
-- on a subnet that allows broadcasts

-- (From EM_NETWORK_CONSTANTS)

in_addr_unresolved: INTEGER

-- Used for listening on all network interfaces

-- (From EM_NETWORK_CONSTANTS)

lf: INTEGER

-- Line feed character code

-- (From EM_NETWORK_CONSTANTS)

max_port_number: INTEGER

-- Highest valid value for a socket port

-- (From EM_NETWORK_CONSTANTS)

max_udp_packet_size: INTEGER

-- Maximum size of a UDP packet

-- (From EM_NETWORK_CONSTANTS)

min_port_number: INTEGER

-- Lowest valid value for a socket port

-- (From EM_NETWORK_CONSTANTS)

max_serialization_byte_count: INTEGER_REF

-- max serialization count

-- (From EM_NETWORK_CONSTANTS)

set_max_serialization_byte_count (a_count: INTEGER)

-- Set max_serialization_count to a_count.
-- If UDP is used this value should be *less* than Max_udp_packet_size.

-- (From EM_NETWORK_CONSTANTS)

ensure
max_serialization_byte_count_set: max_serialization_byte_count.item = a_count

feature -- Status report

is_valid_ip_string (an_ip_string: STRING): BOOLEAN

-- Is an_ip_string a valid IP string?

require
an_ip_string_not_void: an_ip_string /= Void

feature -- Conversion

convert_from_big_endian_16 (value: INTEGER): INTEGER

-- Convert a 16 bit value from network byte order (big endian) to the
-- byte order of this system.

convert_from_big_endian_32 (value: INTEGER): INTEGER

-- Convert a 32 bit value from network byte order (big endian) to the
-- byte order of this system.

convert_ip_string_to_ip (an_ip_string: STRING): INTEGER

-- Convert an_ip_string to an integer ip.

require
an_ip_string_not_void: an_ip_string /= Void
is_valid_ip_string: is_valid_ip_string(an_ip_string)
convert_to_big_endian_16 (value: INTEGER): INTEGER

-- Convert a 16 bit value from the byte order of the this system
-- to network byte order (big endian).

convert_to_big_endian_32 (value: INTEGER): INTEGER

-- Convert a 32 bit value from the byte order of the this system
-- to network byte order (big endian).

invariant


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

end