N
n30 [Dzej O.]
Hi
I ve got small problem with the "connect"
I made a application waiting for a connection and for a data.
And I written in VS 2005 ap rogram w pocket pc.
Program is working good on the Pc. The problem is that is crashing down
on the pocket.
I tried to use 2 difrent ways to connect:
TcpClient klient = new TcpClient();
klient.Connect(IPAddress.Parse("192.168.1.19"),
int.Parse("6667"));
NetworkStream stream = klient.GetStream();
BinaryWriter w = new BinaryWriter(stream);
w.Write("MSG!");
********************************************************
And:
********************************************************
Socket s = null;
IPEndPoint ipe = new
IPEndPoint(IPAddress.Parse("192.168.1.19"), int.Parse("6667"));
Socket tempSocket = new Socket(ipe.AddressFamily,
SocketType.Stream, ProtocolType.Tcp);
tempSocket.Connect(ipe);
if (tempSocket.Connected)
{
s = tempSocket;
}
string Data_to_send = "MSG!!";
Byte[] bytesSent = Encoding.ASCII.GetBytes(Data_to_send);
s.Send(bytesSent, bytesSent.Length, 0);
*************************************************************
in details after crash on pocket pc in first lines i see problem with
the connect method. Can someone help me?
regards!
Ps. Sorry for language mistakes, EN is not my native.
I ve got small problem with the "connect"
I made a application waiting for a connection and for a data.
And I written in VS 2005 ap rogram w pocket pc.
Program is working good on the Pc. The problem is that is crashing down
on the pocket.
I tried to use 2 difrent ways to connect:
TcpClient klient = new TcpClient();
klient.Connect(IPAddress.Parse("192.168.1.19"),
int.Parse("6667"));
NetworkStream stream = klient.GetStream();
BinaryWriter w = new BinaryWriter(stream);
w.Write("MSG!");
********************************************************
And:
********************************************************
Socket s = null;
IPEndPoint ipe = new
IPEndPoint(IPAddress.Parse("192.168.1.19"), int.Parse("6667"));
Socket tempSocket = new Socket(ipe.AddressFamily,
SocketType.Stream, ProtocolType.Tcp);
tempSocket.Connect(ipe);
if (tempSocket.Connected)
{
s = tempSocket;
}
string Data_to_send = "MSG!!";
Byte[] bytesSent = Encoding.ASCII.GetBytes(Data_to_send);
s.Send(bytesSent, bytesSent.Length, 0);
*************************************************************
in details after crash on pocket pc in first lines i see problem with
the connect method. Can someone help me?
regards!
Ps. Sorry for language mistakes, EN is not my native.