TCP Socket not working - Logic issue?

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.


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();
 
D

Daniel Moth

There doesn't seem to be anything CF-specific in your question (you are
referring to "laptop" and "desktop")

Try posting to a desktop newsgroup and include code for both sides:
sending/receiving (client/server). You are only (partially) showing one
side...

Cheers
Daniel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top