G
Gravity
Hi,
I have a TCP server running on my desktop. While another TCP client running
on my laptop. Both written in raw C/C++ and they work perfectly fine.
Now I am developing socket application using C# on the same laptop as TCP
client.
It basically connect to the server, send a packet and recv the data. But
what happen is that there is completely no activities going on when I trigge
the function using button. My desktop network activities also complete IDLE
despice several clicks from my C# clients.
Here is my basic logic of codes. I guess there must be some silly mistakes.
Hope you can pin point to me.
Thanks for reading.
MemoryStream f_MemoryStream = new MemoryStream(20);
TcpClient f_Client = new TcpClient();
Byte[] f_DataSend = new Byte[50000];
Byte[] f_DataRecv = new Byte[50000];
f_Client.Connect("192.168.1.2", 8000);
NetworkStream f_Stream = f_Client.GetStream();
f_Stream.Write(f_DataSend, 0, f_DataSend.Length);
Int32 f_LengthRecv = f_Stream.Read(f_DataRecv, 0, f_DataRecv.Length);
f_Client.Close();
f_Stream.Close();
f_MemoryStream.Close();
I have a TCP server running on my desktop. While another TCP client running
on my laptop. Both written in raw C/C++ and they work perfectly fine.
Now I am developing socket application using C# on the same laptop as TCP
client.
It basically connect to the server, send a packet and recv the data. But
what happen is that there is completely no activities going on when I trigge
the function using button. My desktop network activities also complete IDLE
despice several clicks from my C# clients.
Here is my basic logic of codes. I guess there must be some silly mistakes.
Hope you can pin point to me.
Thanks for reading.
MemoryStream f_MemoryStream = new MemoryStream(20);
TcpClient f_Client = new TcpClient();
Byte[] f_DataSend = new Byte[50000];
Byte[] f_DataRecv = new Byte[50000];
f_Client.Connect("192.168.1.2", 8000);
NetworkStream f_Stream = f_Client.GetStream();
f_Stream.Write(f_DataSend, 0, f_DataSend.Length);
Int32 f_LengthRecv = f_Stream.Read(f_DataRecv, 0, f_DataRecv.Length);
f_Client.Close();
f_Stream.Close();
f_MemoryStream.Close();