예제 #1
0
        public frmWebLogin()
        {
            InitializeComponent();

            asyncControl = new AsyncControl();
            this.Controls.Add(asyncControl);
            tsEndLoginButton.ButtonClick += TsEndLoginButton_ButtonClick;
            this.SizeChanged             += FrmWebLogin_SizeChanged;
        }
예제 #2
0
        public static void Initialize()
        {
            lock (typeof(PlayerConnection))
            {
                if (initialized)
                {
                    return;
                }

                string headerFile = System.Web.Configuration.WebConfigurationManager.AppSettings["HeaderFile"];

                ID3V2_Header = System.IO.File.ReadAllBytes(headerFile);


                Initializer.Initialize(Program.INTEGRATION_INITIALIZATION);

                _control = Initializer.Control;
                _control.PushCommand("ldasm CPlayerStreamer.dll");
                _control.PushCommand("setp 2");
                _control.PushCommand("starthkm");
                _control.WaitQueueExecution();

                CPlayerStreamer.ImmediateStreamer streamer = Player.GetInstance().GetImplementer() as CPlayerStreamer.ImmediateStreamer;
                streamer.PushData += (o, d) =>
                {
                    LastDataPacket = d;
                    DataRecived.Set();
                    DataRecived.Reset();
                };

                CPlayer.Output.Display.Print += (sender, text, color, newLine) =>
                {
                    if (newLine)
                    {
                        _sb.AppendLine(text);
                    }
                    else
                    {
                        _sb.Append(text);
                    }



                    LastOutput = text;
                    TextRecieved.Set();
                    TextRecieved.Reset();
                };
                _buffer     = new ReceiveBuffer();
                initialized = true;
            }
        }
예제 #3
0
파일: Stream.cs 프로젝트: ForNeVeR/pnet
        // Begin an asychronous write operation.
        public virtual IAsyncResult BeginWrite
            (byte[] buffer, int offset, int count,
            AsyncCallback callback, Object state)
        {
            // Validate the parameters and the stream.
            ValidateBuffer(buffer, offset, count);
            if (!CanWrite)
            {
                throw new NotSupportedException(_("IO_NotSupp_Write"));
            }

            // Create the result object.
            AsyncControl async = new AsyncControl
                                     (callback, state, this, buffer, offset, count, false);

            // Start the background write.
            async.Start();
            return(async);
        }
예제 #4
0
	// Begin an asynchronous operation to send from this socket.
	public IAsyncResult BeginSendTo(byte[] buffer, int offset, int size,
								 	SocketFlags socketFlags,
									EndPoint remoteEP,
								 	AsyncCallback callback,
								 	Object state)
			{
				// Validate the parameters.
				ValidateBuffer(buffer, offset, size);
				if(remoteEP == null)
				{
					throw new ArgumentNullException("remoteEP");
				}
				else if(remoteEP.AddressFamily != family)
				{
					throw new SocketException(Errno.EINVAL);
				}

				// Create the result object.
				AsyncControl async = new AsyncControl
					(callback, state, this, buffer, offset, size,
					 socketFlags, remoteEP, AsyncOperation.SendTo);

				// Start the background process.
				async.Start();
				return async;
			}
예제 #5
0
	// Begin an asynchronous operation to send on this socket.
	public IAsyncResult BeginSend(byte[] buffer, int offset, int size,
								  SocketFlags socketFlags,
								  AsyncCallback callback,
								  Object state)
			{
				// Validate the parameters.
				ValidateBuffer(buffer, offset, size);

				// Create the result object.
				AsyncControl async = new AsyncControl
					(callback, state, this, buffer, offset, size,
					 socketFlags, null, AsyncOperation.Send);

				// Start the background process.
				async.Start();
				return async;
			}
예제 #6
0
	// Begin an asynchronous operation to connect on this socket.
	public IAsyncResult BeginConnect(EndPoint remoteEP,
									 AsyncCallback callback,
									 Object state)
			{
				// Validate the parameters.
				if(remoteEP == null)
				{
					throw new ArgumentNullException("remoteEP");
				}
				else if(remoteEP.AddressFamily != family)
				{
					throw new SocketException(Errno.EINVAL);
				}

				// Create the result object.
				AsyncControl async = new AsyncControl
					(callback, state, this, null, 0, 0,
					 SocketFlags.None, remoteEP, AsyncOperation.Connect);

				// Start the background process.
				async.Start();
				return async;
			}
예제 #7
0
	}; // class AsyncControl

	// Begin an asynchronous operation to accept an incoming connection.
	public IAsyncResult BeginAccept(AsyncCallback callback, Object state)
			{
				// Create the result object.
				AsyncControl async = new AsyncControl
					(callback, state, this, null, 0, 0,
					 SocketFlags.None, null, AsyncOperation.Accept);

				// Start the background process.
				async.Start();
				return async;
			}
예제 #8
0
	// Begin an asychronous write operation.
	public virtual IAsyncResult BeginWrite
				(byte[] buffer, int offset, int count,
				 AsyncCallback callback, Object state)
			{
				// Validate the parameters and the stream.
				ValidateBuffer(buffer, offset, count);
				if(!CanWrite)
				{
					throw new NotSupportedException(_("IO_NotSupp_Write"));
				}

				// Create the result object.
				AsyncControl async = new AsyncControl
					(callback, state, this, buffer, offset, count, false);

				// Start the background write.
				async.Start();
				return async;
			}