/src/lib/sequencer/events/network_connection_occurred.e
Specman e | 60 lines | 27 code | 7 blank | 26 comment | 0 complexity | fbad5b31793e8a83d1c05e8329851791 MD5 | raw file
1-- This file is part of a Liberty Eiffel library. 2-- See the full copyright at the end. 3-- 4class NETWORK_CONNECTION_OCCURRED 5 -- 6 -- Event: a new network connection was established to the given `server' 7 -- 8 9inherit 10 EVENT_DESCRIPTOR 11 12create {SOCKET_SERVER} 13 make 14 15feature {EVENTS_SET} 16 expect (events: EVENTS_SET) 17 do 18 events.when_connection(server) 19 set_expected(events) 20 end 21 22 occurred (events: EVENTS_SET): BOOLEAN 23 do 24 Result := events.is_connection(server) 25 end 26 27feature {} 28 server: SOCKET_SERVER 29 30 make (a_server: like server) 31 require 32 not is_expected 33 a_server /= Void 34 do 35 server := a_server 36 ensure 37 server = a_server 38 end 39 40end -- class NETWORK_CONNECTION_OCCURRED 41-- 42-- Copyright (C) 2009-2017: by all the people cited in the AUTHORS file. 43-- 44-- Permission is hereby granted, free of charge, to any person obtaining a copy 45-- of this software and associated documentation files (the "Software"), to deal 46-- in the Software without restriction, including without limitation the rights 47-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 48-- copies of the Software, and to permit persons to whom the Software is 49-- furnished to do so, subject to the following conditions: 50-- 51-- The above copyright notice and this permission notice shall be included in 52-- all copies or substantial portions of the Software. 53-- 54-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 55-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 56-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 57-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 58-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 59-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 60-- THE SOFTWARE.