Пример #1
0
        private void Dispose(bool disposing)
        {
            lock (this)
            {
                if (!this.disposed)
                {
                    try
                    {
                        // release any unmanaged resources
                        this.Detach();

                        // release any managed resources
                        if (disposing)
                        {
                            this.connection       = null;
                            this.charset          = null;
                            this.eventManager     = null;
                            this.serverVersion    = null;
                            this.dialect          = 0;
                            this.eventsId         = 0;
                            this.handle           = 0;
                            this.packetSize       = 0;
                            this.warningMessage   = null;
                            this.transactionCount = 0;
                        }
                    }
                    finally
                    {
                    }

                    this.disposed = true;
                }
            }
        }
Пример #2
0
 public void CloseEventManager()
 {
     lock (this)
     {
         if (this.eventManager != null)
         {
             this.eventManager.Close();
             this.eventManager = null;
         }
     }
 }
Пример #3
0
        public void QueueEvents(RemoteEvent events)
        {
            if (this.eventManager == null)
            {
                string ipAddress  = string.Empty;
                int    portNumber = 0;
                int    auxHandle  = 0;

                this.ConnectionRequest(out auxHandle, out ipAddress, out portNumber);

                this.eventManager = new GdsEventManager(auxHandle, ipAddress, portNumber);
            }

            lock (this)
            {
                try
                {
                    events.LocalId = ++this.eventsId;

                    EventParameterBuffer epb = events.ToEpb();

                    this.Send.Write(IscCodes.op_que_events);                    // Op codes
                    this.Send.Write(this.handle);                               // Database	object id
                    this.Send.WriteBuffer(epb.ToArray());                       // Event description block
                    this.Send.Write(0);                                         // Address of ast routine
                    this.Send.Write(0);                                         // Argument	to ast routine
                    this.Send.Write(events.LocalId);                            // Client side id of remote	event

                    this.Send.Flush();

                    // Update event	Remote event ID
                    events.RemoteId = this.ReadGenericResponse().ObjectHandle;

                    // Enqueue events in the event manager
                    this.eventManager.QueueEvents(events);
                }
                catch (IOException)
                {
                    throw new IscException(IscCodes.isc_net_read_err);
                }
            }
        }
Пример #4
0
		public void QueueEvents(RemoteEvent events)
		{
			if (this.eventManager == null)
			{
				string	ipAddress	= string.Empty;
				int		portNumber	= 0;
				int		auxHandle	= 0;

				this.ConnectionRequest(out auxHandle, out ipAddress, out portNumber);

				this.eventManager = new GdsEventManager(auxHandle, ipAddress, portNumber);
			}

			lock (this)
			{
				try
				{
					events.LocalId = ++this.eventsId;

					EventParameterBuffer epb = events.ToEpb();

					this.Send.Write(IscCodes.op_que_events);// Op codes
					this.Send.Write(this.handle);			// Database	object id
					this.Send.WriteBuffer(epb.ToArray());	// Event description block
					this.Send.Write(0);						// Address of ast routine
					this.Send.Write(0);						// Argument	to ast routine						
					this.Send.Write(events.LocalId);		// Client side id of remote	event

					this.Send.Flush();

					// Update event	Remote event ID
					events.RemoteId = this.ReadGenericResponse().ObjectHandle;

					// Enqueue events in the event manager
					this.eventManager.QueueEvents(events);
				}
				catch (IOException)
				{
					throw new IscException(IscCodes.isc_net_read_err);
				}
			}
		}
Пример #5
0
		public void CloseEventManager()
		{
			lock (this)
			{
				if (this.eventManager != null)
				{
					this.eventManager.Close();
					this.eventManager = null;
				}
			}
		}
Пример #6
0
		private void Dispose(bool disposing)
		{
			lock (this)
			{
				if (!this.disposed)
				{
					try
					{
						// release any unmanaged resources
						this.Detach();

						// release any managed resources
						if (disposing)
						{
							this.connection		= null;
							this.charset		= null;
							this.eventManager	= null;
							this.serverVersion	= null;
							this.dialect		= 0;
							this.eventsId		= 0;
							this.handle			= 0;
							this.packetSize		= 0;
							this.warningMessage = null;
							this.transactionCount = 0;
						}
					}
					finally
					{
					}

					this.disposed = true;
				}
			}
		}