Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- byte[] messagebuffer = Encoding.ASCII.GetBytes(txtMessage.Text);
- stream.Write(messagebuffer, 0, messagebuffer.Length);
- socket = new Socket(AddressFamily.InterNetwork, SocketType.Raw, ProtocolType.IP);
- socket.Bind(new IPEndPoint(IPAddress.Parse(comboBox1.SelectedItem.ToString()), int.Parse(tbPort.Text)));
- socket.SetSocketOption(SocketOptionLevel.IP, SocketOptionName.HeaderIncluded, true);
- byte[] byInc = new byte[] { 1, 0, 0, 0 };
- byte[] byOut = new byte[4];
- buffer = new byte[4096];
- socket.IOControl(IOControlCode.ReceiveAll, byInc, byOut);
- socket.BeginReceive(buffer, 0, buffer.Length, SocketFlags.None, OnReceive, null);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement