/src/lib/sequencer/events/network_connection_occurred.e

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