Jump to content



Photo

TCP File Transfer


  • Please log in to reply
12 replies to this topic

#1 dantay9

dantay9

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 834 posts

Posted 06 July 2009 - 01:22 AM

I know there are several FTP UDF's, but I had trouble finding examples. I also had a little trouble finding TCP sending systems that worked. And those that did work, didn't have a gui or anything. So I made a simple TCP file transfer system with a gui. It is for learning purposes. It isn't a big program, just an small, working example of how to use TCP protocol. Tell me how you like it.

Previous downloads: 72

Attached Files


Edited by dantay9, 19 August 2009 - 03:10 AM.

"Failure is not an option -- it comes packaged with Windows" Gecko Web Browser, Yahtzee!, Toolbar Launcher (like RocketDock)Internet Blocker, Simple Calculator, Local Weather, Easy GDI+ GUI Triangle Solver, TCP File Transfer, Valuater's Autoit WrappersOOP In AutoItUsing Windows XP SP3, 1GB RAM, AMD Athlon Processor @ 2.1 GHzCheck me out at gadgets.freehostrocket.com





#2 dexto

dexto

    Polymath

  • Active Members
  • PipPipPipPip
  • 239 posts

Posted 06 July 2009 - 04:42 AM

Thx a bunch!
Too lazy for anything other then AutoIT.

#3 dantay9

dantay9

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 834 posts

Posted 06 July 2009 - 05:13 PM

Thanks! Mine is one of the smallest working file transfer systems with a gui on the forum. If you are looking for something a little more advanced, take a look at ftp. I think it is much easier to transfer files using ftp. A great example is Pocket FT.

Edited by dantay9, 06 July 2009 - 05:14 PM.

"Failure is not an option -- it comes packaged with Windows" Gecko Web Browser, Yahtzee!, Toolbar Launcher (like RocketDock)Internet Blocker, Simple Calculator, Local Weather, Easy GDI+ GUI Triangle Solver, TCP File Transfer, Valuater's Autoit WrappersOOP In AutoItUsing Windows XP SP3, 1GB RAM, AMD Athlon Processor @ 2.1 GHzCheck me out at gadgets.freehostrocket.com

#4 playlet

playlet

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 459 posts

Posted 08 July 2009 - 11:26 AM

This is a very good script. It would be better if you added drag and drop function. Is there any way to reset script without stopping it and running again?

#5 FireFox

FireFox

    Liar using Chrome :>

  • Active Members
  • PipPipPipPipPipPip
  • 3,173 posts

Posted 08 July 2009 - 11:51 AM

@dantay9
I know that my FT-Pocket is a good example, but in this way i can't make better because autoit language does not support multi threading so I can't make a big program like Torrent to send and receive files from different ips, wich is very interessant...

I don't know if you have some ideas about your or mine script, but you can pm me and we will work together on it :)

Cheers, FireFox.
OS : Win XP SP3 / Win 7 SP1 / Win 8 | Autoit version: latest stable / beta

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | What you've done today | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : IP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

Updated 22 April, 2013 - If you find dead links please send me a PM, do not post in the topics !

#6 dantay9

dantay9

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 834 posts

Posted 08 July 2009 - 05:59 PM

@playlet

Welcome to the forum!

Yes there is a way. Seeing as you are new here, I will explain why you had to restart the program every time you sent a file. The reason was I never closed the listening port made at the very beginning of my receiver function. Before you can make a socket on a port, you must make sure you close all other sockets on that port. I closed the socket at the end of my receiver function.
I also added the drag and drop to the send tab. You don't need it for the receive tab because the input should be a folder, not a file.

Edited by dantay9, 08 July 2009 - 06:02 PM.

"Failure is not an option -- it comes packaged with Windows" Gecko Web Browser, Yahtzee!, Toolbar Launcher (like RocketDock)Internet Blocker, Simple Calculator, Local Weather, Easy GDI+ GUI Triangle Solver, TCP File Transfer, Valuater's Autoit WrappersOOP In AutoItUsing Windows XP SP3, 1GB RAM, AMD Athlon Processor @ 2.1 GHzCheck me out at gadgets.freehostrocket.com

#7 playlet

playlet

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 459 posts

Posted 08 July 2009 - 09:09 PM

Works great now! Thanks, dantay9

#8 Xand3r

Xand3r

    Aka TheMadman

  • Active Members
  • PipPipPipPipPipPip
  • 454 posts

Posted 08 July 2009 - 10:04 PM

before you can make a socket on a port, you must make sure you close all other sockets on that port. I closed the socket at the end of my receiver function.


false...
you can create more than one socket on a listening port i.e. you listen on port 80 and you have one client conected... if another client tries to connect you don't have to close the socket on the first client in order to make room for the second ... you can just handle both :)
Only two things are infinite, the universe and human stupidity, and i'm not sure about the former -Alber EinsteinPractice makes perfect! but nobody's perfect so why practice at all?http://forum.ambrozie.ro

#9 dantay9

dantay9

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 834 posts

Posted 09 July 2009 - 01:49 AM

false...
you can create more than one socket on a listening port i.e. you listen on port 80 and you have one client conected... if another client tries to connect you don't have to close the socket on the first client in order to make room for the second ... you can just handle both :)


Yes, I know that. But, the way my script is set up, for noobs, I create a new listening socket each time a file is received. It is for visual learning purpose and allows people to use the function without it relying on any other functions or variables.

Edited by dantay9, 20 August 2009 - 04:47 AM.

"Failure is not an option -- it comes packaged with Windows" Gecko Web Browser, Yahtzee!, Toolbar Launcher (like RocketDock)Internet Blocker, Simple Calculator, Local Weather, Easy GDI+ GUI Triangle Solver, TCP File Transfer, Valuater's Autoit WrappersOOP In AutoItUsing Windows XP SP3, 1GB RAM, AMD Athlon Processor @ 2.1 GHzCheck me out at gadgets.freehostrocket.com

#10 playlet

playlet

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 459 posts

Posted 03 August 2009 - 01:28 AM

Hi, dantay9

Can you please explain how can "waiting for file" be canceled using a button like "cancel waiting...".
If you pressed this "cancel waiting..." button everything would be like you ran the script all over again (you can set the receive-folder again and start waiting for file again).

I hope you know what I mean.

Thanks, Playlet

#11 dantay9

dantay9

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 834 posts

Posted 05 August 2009 - 12:17 AM

I think I know what you mean, but it all depends on what loop you want to exit the _ReceiveFile function at. Figure out which loop you want (or all three) and put something like this into the loop:

If _IsPressed("1B") Then ;Esc key FileClose($FileHandle) ;only use after $FileHandle is opened TCPCloseSocket($Socket) TCPCloseSocket($Listen) ToolTip("") EndIf


That is for a keypress. You should be able to figure it out using a button with the same principles. Remember, this is just a very simple transfer program. There are much better and more involved programs on the forum.
"Failure is not an option -- it comes packaged with Windows" Gecko Web Browser, Yahtzee!, Toolbar Launcher (like RocketDock)Internet Blocker, Simple Calculator, Local Weather, Easy GDI+ GUI Triangle Solver, TCP File Transfer, Valuater's Autoit WrappersOOP In AutoItUsing Windows XP SP3, 1GB RAM, AMD Athlon Processor @ 2.1 GHzCheck me out at gadgets.freehostrocket.com

#12 playlet

playlet

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 459 posts

Posted 05 August 2009 - 12:32 PM

Thanks for replying, dantay9

I already figured this out, just thought there was some other way to do it. I asked this because I have combined it with a chat script (single script file) and that gave me some more problems. But I've solved them now.

Thanks, Playlet

Edited by playlet, 06 August 2009 - 11:06 PM.


#13 playlet

playlet

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 459 posts

Posted 03 December 2010 - 06:46 PM

Hi, guys!

Can anyone explain to me why this is not working with wireless connections. If either sender or receiver uses a wireless connection to router (connected on adsl), connection can not be made.
I have found out that it has something to do with IP addresses. I use _GetIP() to obtain IP addresses.

Is there a way to fix this?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users