Пример #1
0
		public AmqpTcpListener(AmqpSettings settings, AmqpServerContext context)
		{
			this.settings = settings;
			this.context = context;

			try {
				this.listener = new TcpListener (new IPEndPoint (settings.IpAddress, settings.Port));
				listener.Start ();
				Event.Publish (new AmqpServerStarted(this.settings.IpAddress, this.settings.Port));
			} catch {
				Event.Publish (new AmqpServerFailedToStart(this.settings.IpAddress, this.settings.Port));
			}
		}
Пример #2
0
		public AmqpServer (AmqpSettingsBuilder settingsBuilder)
		{
			this.settings = settingsBuilder.Build ();
			this.context = new AmqpServerContext (new CancellationTokenSource ());
		}