Hello...
Could maybe a couple of you try this example code out and let me know what happens on your machine. I cant get this code to run without hanging.
Cheers!
Could maybe a couple of you try this example code out and let me know what happens on your machine. I cant get this code to run without hanging.
Code:
#compile exe #register none #include "win32api.inc" #include "wsock32.inc" function pbmain() as long dim message as string dim buffer as string dim hsock as long rem Open socket to PowerBasic FTP hsock = freefile tcp open port 21 at "ftp.powerbasic.com" as hsock timeout 500 if err then msgbox "Unable to connect to FTP.POWERBASIC.COM" exit function else msgbox "We connected ok..." & $CRLF & _ "but now let's see if we can get" & $CRLF & _ "a response from the server." end if rem Read welcome message message = "" do tcp line hsock, buffer rem program hangs up here in debugger message = (message & $CRLF & buffer) loop while len(buffer) msgbox message rem Send username and retreive message tcp print hsock, "user anonymous" message = "" do tcp line hsock, buffer message = (message & $CRLF & buffer) loop while len(buffer) msgbox message rem Send password and retreive message tcp print hsock, "pass [email protected]" message = "" do tcp line hsock, buffer message = (message & $CRLF & buffer) loop while len(buffer) msgbox message & format$(len(buffer)) rem Close socket and bail out tcp close hsock end function
Comment