Torna al Thread
IPAddress ipAdd = IPAddress.Parse("127.0.0.1");
EndPoint ep = new IPEndPoint(ipAdd, 1234);
Socket m_socListener = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.IP);
try
{
m_socListener.Connect(ep);
if (m_socListener.Connected)
{
MessageBox.Show("CONNESSO");
int x = 1;
byte[] byData = System.Text.Encoding.ASCII.GetBytes(Convert.ToString(x));
m_socListener.Send(byData);
}
}
catch (SocketException se)
{
MessageBox.Show(se.Message);
}