Want to know about .Net Socket Implementation

F

Faisal

Hi, People
I have written an ftpclient in .net now a strange thing is happening
while debugging every thing is working all right but when i run the
program normally the system hangs on socket.receive() can any body give
me any clues why this would be happening

This is my code snippet

Socket clientSocket = new Socket( AddressFamily.InterNetwork,
SocketType.Stream, ProtocolType.Tcp );

IPEndPoint Ep=new IPEndPoint(IPAddress.Parse("192.168.1.1");
this.clientSocket.Connect(Ep);


byte[] buffer=new byte[512];

// This is the place where i hang when i run my programming but while
debugging its all ok

int bytesRead=clientSocket.Receive(buffer,buffer.Length,0);



Thanks n Regards to All
 
V

Vadym Stetsyak

Hello, Faisal!

F> This is my code snippet

F> Socket clientSocket = new Socket( AddressFamily.InterNetwork,
F> SocketType.Stream, ProtocolType.Tcp );

F> IPEndPoint Ep=new IPEndPoint(IPAddress.Parse("192.168.1.1");
F> this.clientSocket.Connect(Ep);

F> byte[] buffer=new byte[512];

F> // This is the place where i hang when i run my programming but while
F> debugging its all ok

F> int bytesRead=clientSocket.Receive(buffer,buffer.Length,0);

read my answer on microsoft.public.win32.programmer.networks

--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com
 

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

Top