Peter,
Socket mySocket = new Socket (System.IntPtr. Zero);<<here
What do I put here (...)?
I get some type of error code no matter what I put:
"CS0122: 'System.Net.Soc kets.Socket.Soc ket(System.IntP tr)' is
inaccessible due to its protection level."
Here is my code before that:
private void button12_Click( object sender, System.EventArg s e)
{
IPHostEntry ipHostInfo = Dns.Resolve("NP IFA21AE");
IPAddress ipAddress = ipHostInfo.Addr essList[0];
IPEndPoint ipe = new IPEndPoint(ipAd dress,515);
TcpClient s = new TcpClient();
//IPAddress Send = ipHostInfo.Addr essList[0];
try
{
s.Connect(ipe);
}
catch(ArgumentN ullException ae)
{
Console.WriteLi ne("ArgumentNul lException : {0}", ae.ToString());
// listBox1.Items. Add("ArgumentNu llException : {0}", ae.ToString());
}
catch(SocketExc eption se)
{
Console.WriteLi ne("SocketExcep tion : {0}", se.ToString());
// listBox1.Items. Add("SocketExce ption : {0}", se.ToString());
}
catch(Exception se)
{
Console.WriteLi ne("Unexpected exception : {0}", e.ToString());
// listBox1.Items. Add("Unexpected exception : {0}", e.ToString());
}
//
// byte[] msg = System.Text.Enc oding.ASCII.Get Bytes("This is a test");
// int bytesSent = s.Send(msg);
//
// byte[] bytes = new byte[1024];
// int bytesRec = s.Receive(bytes );
// Console.WriteLi ne("Echoed text = {0}",
// System.Text.Enc oding.ASCII.Get String(bytes, 0, bytesRec));
Socket mySocket = new Socket (System.IntPtr. Zero);
int retValue = SendReceiveTest 4(mySocket);
}
Thanks for any help,
Trint
.Net programmer
tr***********@g mail.com
*** Sent via Developersdex
http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!