|
| ||||||||||
| Tags: end of file, eof, file, file system, javaio |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| |||
| |||
| EOF not found
I send the contents of a file with my method "sendFile" from client to server and it arrives until the end of file great. For cons, the waiter comes to write the file using the method stock but never goes out of the while loop, never finding a value of -1. That is the EOF is not found by the program. Do you have any ideas about this kind of a problem? If there is solution available with you, then kindly help me. Thanks in advance. Last edited by Aaliya Seth : 25-01-2010 at 12:20 PM. |
|
#2
| ||||
| ||||
| Re: EOF not found
Hello, I have not gone too much in your program but I think the comman mistake most programmer do is to, try to close 2 times did not close the stream properly, though I am not sure. Check if the class dataOut is closed properly. So add to the finally did. Try it just the small change and tell me if it changes something. |
|
#3
| |||
| |||
| Re: EOF not found
Hey Thanks for your reply, I did what you said and the file goes well, by cons I have an error in my post with the loop (a readObject ds a while (true)) that uses these 2 methods for making the dataIn.close () it closes the input connection of the socket. So my readObject throws an exception. Thank you again. If you have any other aternative for this then tell me. |
|
#4
| ||||
| ||||
| Re: EOF not found
Hello, I have not quite captured it. I think you are complicating things now. Why there is a readObjet a while (true) What is this code? Otherwise it is clear that if you use it to open something in the code somewhere else should not close it immediately. I think you need to think again with your code, modify it and post again.
__________________ Grand Theft Auto 4 PC Video Game |
|
#5
| |||
| |||
| Re: EOF not found
Hello, This is how my code works, this is not the complete code, but I have posted the important part of the code, just check it and verify it is correct or not, if not then please guide me. Code: while (true)
{
test = readObject ()
if (test.getClass () == "some")
{
sendFile (clientSocket)
}
}
and server side I have something like this:
while (true)
{
test = readObject ()
stock (clientSocket)
}
} |
|
#6
| |||
| |||
| Re: EOF not found
Hello, Your problem is probably your readObject method because there is nothing wrong. Have you tried that it closes properly and debug the readObject to see it or plant? Maybe you'll have to open a stream in readObject. Other part of the code and the logic seems correct, that is not a large part of your code is wrong. |
![]() |
|
| Thread Tools | Search this Thread |
| |
Similar Threads for: "EOF not found" | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| DNS not found | !Destroyer! | Networking & Security | 4 | 09-12-2010 12:30 AM |
| m4d.dll not found | Zhankana_n | Operating Systems | 5 | 10-03-2010 09:37 AM |
| ATL.DLL Cannot Be Found | MobilePhoneGuru | Operating Systems | 3 | 02-12-2009 08:04 PM |
| Found in my pc | bladesimple | Networking & Security | 3 | 10-03-2009 10:15 PM |