socket.receive [VB .NET] 
Author Message
 socket.receive [VB .NET]

Anyone can tell me why happens that the

socket.receive(buffer, buffer.length, 0)

doesn't work?

The connect sub worked and i received the string "220 ...."
so i sent a "USER user" command but it remain thinking...

Why? :(

Thanks to everyone can help me!!!!

Max



Tue, 16 Aug 2005 07:01:17 GMT  
 socket.receive [VB .NET]
Max, we have no idea what you are working on, what 220 means, what you
expect your app to do, or how you're loading the buffer. How could we
possibly help you?


Quote:
> Anyone can tell me why happens that the

> socket.receive(buffer, buffer.length, 0)

> doesn't work?

> The connect sub worked and i received the string "220 ...."
> so i sent a "USER user" command but it remain thinking...

> Why? :(

> Thanks to everyone can help me!!!!

> Max



Tue, 16 Aug 2005 07:16:05 GMT  
 socket.receive [VB .NET]
i'm trying to connect to a server with sockets.
220 is an answer of the ftp server. My app have just to connect to a ftp
server and to dialog with it.



Quote:
> Max, we have no idea what you are working on, what 220 means, what you
> expect your app to do, or how you're loading the buffer. How could we
> possibly help you?



> > Anyone can tell me why happens that the

> > socket.receive(buffer, buffer.length, 0)

> > doesn't work?

> > The connect sub worked and i received the string "220 ...."
> > so i sent a "USER user" command but it remain thinking...

> > Why? :(

> > Thanks to everyone can help me!!!!

> > Max



Tue, 16 Aug 2005 07:40:13 GMT  
 socket.receive [VB .NET]

Quote:

> i'm trying to connect to a server with sockets.
> 220 is an answer of the ftp server. My app have just to connect to a ftp
> server and to dialog with it.

FTP is a fairly tricky protocol. I believe the data channel and the command
channel are on seperate ports (20 and 21?). You may want to check out the
RFC:

  http://www.w3.org/Protocols/rfc959/Overview.html

However, you're probably better off using a pre-built FTP control.

HTH,
Sean
--
   \___/  Sean Keplinger            
   |o,o|  skeplin at one dot net    
 \/    )  http://spookyworld.dnsalias.com
----mm-----------------------------------



Tue, 16 Aug 2005 08:05:18 GMT  
 socket.receive [VB .NET]
check first if you have some data in buffer...

available=socket.available
if available >0 then
   redim buff(available-1)
  socket.receive(buff,available,socketflags.none)
end if

U may also use a timer to not wait for ever for data


Quote:
> Anyone can tell me why happens that the

> socket.receive(buffer, buffer.length, 0)

> doesn't work?

> The connect sub worked and i received the string "220 ...."
> so i sent a "USER user" command but it remain thinking...

> Why? :(

> Thanks to everyone can help me!!!!

> Max



Tue, 16 Aug 2005 19:33:38 GMT  
 socket.receive [VB .NET]
[Max]

Quote:
> so i sent a "USER user" command but it remain thinking...
> Why? :(

You probably forgot to send the Carriage Return - Line Feed
characters, too ;)
A fairly common mistake!

hth,

Lokar

--
UGIdotNET - http://www.ugidotnet.org



Tue, 16 Aug 2005 19:45:12 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. is net.socket able to block receiving data until it handles the data

2. how to use the system.net.sockets and system.net in VB.net

3. socket.receive fails to receive

4. VB.NET system.net.sockets question

5. Socket OCX supporting send/receive of VB objects?

6. Trouble with System.Net.Sockets.Socket under Windows 98

7. System.Net.Sockets.Socket Problem

8. System.Net.Sockets.Socket State

9. system.net.sockets.socket async server example

10. Detect Remote Disconnection System.Net.Sockets.Socket

11. System.Net.Sockets.Socket.EndReceive has a bogus return value

12. System.NET, System.Net.Sockets -> TCPListener Issue

 

 
Powered by phpBB® Forum Software