case DialogResult.Yes: // "Yes" processing IPAddress ia = IPAddress.Parse(ipAddress); IPEndPoint ie = new IPEndPoint(ia, 5555); Socket sock1 = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); try { sock1.Connect(ie); } catch (SocketException e) { string error = e.ToString(); MessageBox.Show(error, "Problem connecting to host!", MessageBoxButtons.OK, MessageBoxIcon.Warning); sock1.Shutdown(SocketShutdown.Both); sock1.Close(); return; } try { string fMessage = "OUTPut:SQUelch ON"; Encoding ASCII = Encoding.ASCII; Byte[] ByteGet = ASCII.GetBytes(fMessage); sock1.Send(ByteGet, ByteGet.Length, 0); MessageBox.Show("Did Squelch change?", "Check.", MessageBoxButtons.OK, MessageBoxIcon.Warning); sock1.Shutdown(SocketShutdown.Both); sock1.Close(); } catch (SocketException e) { string error = e.ToString(); MessageBox.Show(error, "Problem communicating to host!", MessageBoxButtons.OK, MessageBoxIcon.Warning); sock1.Shutdown(SocketShutdown.Both); sock1.Close(); return; } break;
case DialogResult.Yes:
// "Yes" processing
IPAddress ia = IPAddress.Parse(ipAddress);
IPEndPoint ie = new IPEndPoint(ia, 5555);
Socket sock1 = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
try
{
sock1.Connect(ie);
}
catch (SocketException e)
string error = e.ToString();
MessageBox.Show(error, "Problem connecting to host!",
MessageBoxButtons.OK, MessageBoxIcon.Warning);
sock1.Shutdown(SocketShutdown.Both);
sock1.Close();
return;
string fMessage = "OUTPut:SQUelch ON";
Encoding ASCII = Encoding.ASCII;
Byte[] ByteGet = ASCII.GetBytes(fMessage);
sock1.Send(ByteGet, ByteGet.Length, 0);
MessageBox.Show("Did Squelch change?", "Check.",
MessageBox.Show(error, "Problem communicating to host!",
break;