Ok, um, attached is my program, source and everything. um, basically, it works and it doesnt work.
ok, this program is 'suppose' to be a VERY simple file uploader. :confused:

__Files__
-----------------------
<server.exe> waits for an incoming connection on port 666 from the client.
once connected and it recieves the go ahead command, it sends the file, c:\pic.bmp.
(this file can obviously be changed in the source if needed)
once uploaded, it waits for another go ahead command to re-upload that file
again to the client..

<client.exe> connects to the server, who's ip addy is currently set to my own,
but can be changed in the source code, and sends a bit of data to the server,
letting it know that the client is ready to recieve. The server sends the file
THe client recieves it, and saves it to a file called "c:\output.jpg". After
it has obtained the file, the client is *suppose to* send a bit back to the
server telling it is ready to receieve the same file again.

*******************************
this 'program' is gonna be part of another program of mine, which is
a very simple webcam video uploader.
The server will wait for a connection, then take a picture from the webcam,compress it,
upload it to who is ever is connected, and repeat this process.
The client will 'reliably' recieve this image from the server, and save the
image to a file, updating the image on each download. Aswell, it wouldnt
hurt for the client to display the image.
=-=-=-=-=-=-=-=-=
So far, the server is able to upload a file to the client, ONE TIME.
it does this because i dont know how the fuck to get the client
to know that the file has finished being sent.

as well, the client, if closed using Crtl-alt-del, also closes the
server for some unknown-to-me reason.

UGGHHHHHHHHHHHHHHHHHH!!!!!!!:confused:

i am VERY new to ASM, so i dont know all the proper commands or shortcuts...
nor concept for that matter.

PLEASE, . HELP ME!
****HELP IN ANYWay is appreciated!!!!********

this program has been giving me a headache for days now. and may kill me in a couple more hours.
Posted on 2002-07-25 12:19:58 by Xyster
If I were you ( that's a big if ) I would look at some RFC's to see/learn how HTTP/FTP/SMTP work. I know RFC959 is ftp, I forgot which ones the other ones are.

I would suggest something like once the Server knows to send the file to the client to send the file size, either by an int( binary ) or just as a string and to signal the end of the file size send a \n or \r .... anything.

I wrote a server that would send the file size as a string then \n

I haven't looked at you code but I will and let you know what I can find
Posted on 2002-07-26 14:47:44 by gorshing
Look at RFC2900 for a list of protocols and their corresponding RFC.

http://faqs.org/rfcs/rfc2900.html
Posted on 2002-07-26 15:06:21 by nyook
Winsock FAQ, this is a good place to start learning about winsock.

In your code you need to just look over it. Some of your problems are simple, you are probably just too overwhelmed with a new topic. I can paste your code up here, but I have totally redone everything.


Later,
gorshing
Posted on 2002-07-28 14:36:35 by gorshing
why don't you just set up your own little command protocol...
for example bla.txt[4578954] would mean... a file named
"bla.txt" with 4578954 bytes will be transfered... you can even
include some sophiscated things like a checksum and such...
the part of you program that receives this information knows now
what to do...

after a few tests add additional commands like:

[<filename>]
[<filename>][<bytes_sent>][<crc>]
[<filename>][<bytes_sent>][<crc>]
...
Posted on 2002-08-05 09:31:51 by mob