Jump to content
Sign in to follow this  
yucatan

filesend and filerecieve

Recommended Posts

yucatan

hi i am making a server and a client

and the server needs to send a file to the client but i only have one problem

the file that i'm sending is constandly gettings bigger.. is there any way to stay sending the entire size of the file has been sent

and the client needs to do this recieve and write the file down on the hard drive and when he stays recieving so the file is gettings bigger then add it and dont rewrite the file but stay recieving and adding the data until the transver is compleet i'm talking abouth larger files but constanly the files on the server are gettings bigger and the server olso needs to stay sending until the file dont get bigger anymore can somebody help me on this ?

Share this post


Link to post
Share on other sites
dbzfanatic
yucatan

This has been asked before, and optimized. Search the forums for server and/or client and TCPSend()/TCPRecieve().

i already did but i cant figure it out.. and rasim told me to dont hijack a topic thats why i started one my own

Share this post


Link to post
Share on other sites
dbzfanatic

It's true that hijacking topics is a very bad practice but you should be able to use the principles and ideas behind those servers to suit your needs, if you can not learn from the code already posted in other topics perhaps it is best if you don't use this method as it seems to be beyond your current skill level.

Share this post


Link to post
Share on other sites
yucatan

ok i have my script now working. the file send and recieve works now i have some questions.

i want to sent a file, but the problem is that the file is gettings bigger for a while maby when the file get sendet the file gets bigger

the upcoming 30 min.

eatch seconds the file get some bits larger

i want that that the connections stays open and the sendig does not stop until the server say so

so when the file is not gettings bigger hold the tcp connection open and hold the tcp recieve open until the file on the server side dont get bigger anymore then send a command that the client know that the transmission is done

can somebody help me on that?

this is my code

server

#include<_FileSend.au3>
$g_IP = "127.0.0.1"
TCPStartUp()
$MainSocket = TCPListen($g_IP, 65432,  100 )
If $MainSocket = -1 Then MsgBox(4096, "Test", @error)
While 1
$ConnectedSocket = TCPAccept( $MainSocket)
If $ConnectedSocket >= 0 Then
_FileSend(@DesktopDir&"\naamloos.JPG", $ConnectedSocket)
EndIf
Wend

client

#include<_FileRecieve.au3>
$g_IP = "127.0.0.1"
TCPStartUp()
$socket = TCPConnect( $g_IP, 65432 )
If $socket = -1 Then Exit
ConsoleWrite($socket)
_FileRecieve(@MyDocumentsDir&"\tcp.jpg", $socket)
If @error Then MsgBox(48,"","Error: "&@error)

Share this post


Link to post
Share on other sites
yucatan

ok i have my script now working. the file send and recieve works now i have some questions.

i want to sent a file, but the problem is that the file is gettings bigger for a while maby when the file get sendet the file gets bigger

the upcoming 30 min.

eatch seconds the file get some bits larger

i want that that the connections stays open and the sendig does not stop until the server say so

so when the file is not gettings bigger hold the tcp connection open and hold the tcp recieve open until the file on the server side dont get bigger anymore then send a command that the client know that the transmission is done

can somebody help me on that?

this is my code

server

#include<_FileSend.au3>
$g_IP = "127.0.0.1"
TCPStartUp()
$MainSocket = TCPListen($g_IP, 65432,  100 )
If $MainSocket = -1 Then MsgBox(4096, "Test", @error)
While 1
$ConnectedSocket = TCPAccept( $MainSocket)
If $ConnectedSocket >= 0 Then
_FileSend(@DesktopDir&"\naamloos.JPG", $ConnectedSocket)
EndIf
Wend

client

#include<_FileRecieve.au3>
$g_IP = "127.0.0.1"
TCPStartUp()
$socket = TCPConnect( $g_IP, 65432 )
If $socket = -1 Then Exit
ConsoleWrite($socket)
_FileRecieve(@MyDocumentsDir&"\tcp.jpg", $socket)
If @error Then MsgBox(48,"","Error: "&@error)

pleas somebody.... help me out pleas...

Share this post


Link to post
Share on other sites
yucatan

how i can send a file over tcp that is constandly getting bigger how i can send that ? and that when i recieve i am constandly getting a bigger file..

Share this post


Link to post
Share on other sites
yucatan

*bump*

PLEAS help me on this i'm trying to search for a sellution for 2 weeks now i'have tryed alot but i cant get it working teh way i need it

pleas assit me

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.