Sign in to follow this  
Followers 0
CodyBarrett

Ftp thrrough TCP chat?

11 posts in this topic

i wanna send files... exes... anything.. and have a display picture sent to the client\server of an tcp chat is this possible with autoit?

Share this post


Link to post
Share on other sites



i wanna send files... exes... anything.. and have a display picture sent to the client\server of an tcp chat is this possible with autoit?

I suppose that if the tcp chat is just for text then you could convert the files to readable text and send them that way assuming they can be converted the other end.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

I suppose that if the tcp chat is just for text then you could convert the files to readable text and send them that way assuming they can be converted the other end.

Yep, ideally you would use Base64 for that purpose.

Although you have 2 other options.

1) Clients connect directly to eachother, this requires correct port forwarding if they own a router. MSN does this as a primary option.

Or .. You do the following ( MSNs secondary option, most used. )

1) Two clients establish the fact that they are going to be sharing a file with each other, who sends it, who receives. This is done on the normal connection.

2) The server then tells both of the clients to connect to an IP:Port opened especially for them. Some authentication is done based on previously established facts.

3) The one who sends it starts sending the file as binary data, and the server just relays the messages to the client.

Share this post


Link to post
Share on other sites

1) Two clients establish the fact that they are going to be sharing a file with each other, who sends it, who receives. This is done on the normal connection.

2) The server then tells both of the clients to connect to an IP:Port opened especially for them. Some authentication is done based on previously established facts.

3) The one who sends it starts sending the file as binary data, and the server just relays the messages to the client.

it's always better to try to connect the clients to each other and only if that fails try the "proxy" way

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

Share this post


Link to post
Share on other sites

well... i know how to share TEXT docments... but for pictures and other files.. i tried converting a .bmp to binary and it maxed out the autoit character per line.... so... any ideas for files other than text

Share this post


Link to post
Share on other sites

well... i know how to share TEXT docments... but for pictures and other files.. i tried converting a .bmp to binary and it maxed out the autoit character per line.... so... any ideas for files other than text

Show us your code, then please. You should be able to send files ( in chunks ) just fine.

it's always better to try to connect the clients to each other and only if that fails try the "proxy" way

That's what I said. Thanks for repeating me.

Share this post


Link to post
Share on other sites

well.. here are the server.au3 (modified from john2006) and the client.au3(same ORIGINAL author) BTW i have no idea where to start with file sending EXCEPT for texts..(havent added text sharing in yet)

;i didnt want to post the whole code;

keep these files IN THE SAME FOLDER

Share this post


Link to post
Share on other sites

well.. here are the server.au3 (modified from john2006) and the client.au3(same ORIGINAL author) BTW i have no idea where to start with file sending EXCEPT for texts..(havent added text sharing in yet)

;i didnt want to post the whole code;

keep these files IN THE SAME FOLDER

heres what you could do

split the file into 1kb chunks

send it in binary-stringformat(for example: 0x0001c)

return it to string

save it to file

Share this post


Link to post
Share on other sites

urmm... ill lookinto the binary stuff... spliting into 1kb's would take a while wouldnt it.. also REFORMING the file after splitting and sending then recieving how would you rejoin the file?... lol as you can see im newbish at internet protocals

Share this post


Link to post
Share on other sites

urmm... ill lookinto the binary stuff... spliting into 1kb's would take a while wouldnt it.. also REFORMING the file after splitting and sending then recieving how would you rejoin the file?... lol as you can see im newbish at internet protocals

use stringchop by siao to splip the string

$array = _StringChop($data,1024)

Func _StringChop($string, $size)
$count = Ceiling(StringLen($string)/$size)
Dim $array[$count+1], $start = 1
For $i = 1 To $count
    $array[$i] = StringMid($string, $start, $size)
    $start += $size
Next
$array[0] = $count
Return $array
EndFunc

then you send your initialization protocol via the chat room(eg:

inittransfer

filename|lol.exe

numberofparts|todo:insertnumberofpartshere)

then for $i = 1 to $array[0]

sendmsgtochatroom($partnum & "|" & string(binary($array[$i])

next

sendmsgtochatroom("alldone")

the client would:

listen for inittransfer

get the file name

getthe number of parts

declare $array[$numberofparts + 1]

$array[0] = $numberofparts

start reciving data and would put it into the array

then would

for $i = 1 to $array[0]

filewrite("filename",binarytostring($array[$i])

next

exit

Share this post


Link to post
Share on other sites

0_0 uhhh lol ill get back to you on this

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0