I am trying to create an event that is triggerd by reciving a packet but it does not work.
#region Recive Packet Event Group
protected virtual void OnRecivePacket(BnetPacketArgs e)
{
if (BnetSocket.Available != 0)
{
RecivePacket(this, e);
}
}
public delegate void BnetPacketHandler(object sender, BnetPacketArgs e);
public event BnetPacketHandler RecivePacket;
private void bnetSocket_RecivePacket(object sender, BnetPacketArgs e)
{
PS.AddPacket(e.inBuffer);
}
#endregion
And this is in the constructor:
this.RecivePacket += new BnetPacketHandler(bnetSocket_RecivePacket);
Could someone tell me what I am doing wrong?
Although I doubt this is relevant, you misspelled "Receive" you spelled it "Recive"
Please avoid double-posts. This question was correctly asked on the .NET Platform forum, and does not belong here.