hi everyone,
I have a slight problem.Im working with a client server pair on my own computer and just runing the server on this computer as well.On the client side i am trying to send an updated file to the server, then save that file on the servers drive (in this case my drive just another folder then where the client is sending the file from ).
Iv already learned how to send a file from a server to a client and save it on the client local drive, now im just trying to do the oposite and figured it would be quite easy.I think i am runing into a timing issue when im caling the methods for sending the file on the client side, and recieveing it on the server side, but im not sure, because i just leanred how to write client servers last week.
I've traced through the code tons of times and again have it narrowed down to the readInt() on the server side...im kind of wondering if the server "waits" at this line until a writeInt(int val) on the client side occurs.If it does wait for the writeInt() to occur on the client side, then im not quite sure whats wrong with my code.In fact i ran the code one time and it worked, i have no idea why it owuld work then not work the next time...anyways..it hasnt worked since so im here..
.
I'm just kind of confused too because on my client side iv put numerous println's to see what was goin down, and the method where i send the file to the server...i have a writeInt() at this point i think the server should be waiting for a writeInt() to come through the stream...but yah..anyways after that writeInt() i also have a write(byte[] buff), and the printlns show these are both being written out on the stream, but its geting an IOError on the server side when it tryes to do the readInt(), so im not quite sure how it does the write(byte[] buff) if the server couldnt even readInt().
Since this post has kinda goten prety long and ppl dont like reading long things...ill post the code for the two methods in new post.
Hopefully i didnt confuse everyone in all that...
If you have any ideas what im doing wrong before or after u look at the code feel free to critsize me!
thnks
-luc