protected override void handleInput(object Sender, ShitBag shit) { buffer.AddRange(shit.buffer); process_buffer(); }
/// <summary> /// Whenever data is received, you can always find it here! /// </summary> /// <param name="sm">Object that received the data.</param> /// <param name="data">byte array of data received.</param> /// <param name="size">Size of the byte array</param> protected virtual void handleInput(object Sender, ShitBag shit) { return; }
private void StartReceiving() { try { // Create the state object. ShitBag state = new ShitBag(); state.workSocket = ShittySocket.Client; // Begin receiving the data from the remote device. ShittySocket.Client.BeginReceive(state.buffer, 0, ShitBag.BufferSize, 0, new AsyncCallback(doInput), state); } catch(SocketException e) { #if DEBUG System.Diagnostics.Debugger.Break(); #endif onError.Invoke(this, e, "Error trying to receive data."); } }
private void _rSock_onInput(object sm, ShitBag bag) { _lSock.WriteData(bag.buffer); }