Results 1 to 2 of 2
Thread: Java application using sockets!
- 06-02-2008, 01:40 PM #1Member
- Join Date
- Dec 2007
- Rep Power
Java application using sockets!
I am developing an application that uses the socket to transfer files from client to server.
In the server there is a module(say ChatServerModule) that is responsible to read the data from the socket and write to the file.
In the client there is a module (module Login) that validates the user,Graphmodule which is a simple GUI that shows who all are using the system currently.
There is mechanism of clicking on the name of the present user in Graphmodule which in turn will call another module say FileSendModule which is responsible to send the file to the user whose name was clicked.
Everything is ok with files size<=64KB but when larger files are tried to send then the application hangs out.
To be noted: when the chatServerModule is run and the FileSendModule is directly run(providing static name or ip of the online user) then it works for files even larger too.
I am very much confused what is happening with?
Is this the problem with the calling of the FileSendModule?Or is this the problem with Threading or what.Can anyone provide me some suggestions?Please help me.
- 06-11-2008, 06:13 PM #2
Socket is having limitation of about 64k in the documentation, somewhat lower in actuality - maybe 40+ k or something. Files must be read in blocks lower than this amount or Socket.read() / .write() will hang or otherwise run erratic.
Send and recieve are implemented by the system, actually. I think of a badger sticking a single wire above the ground. Without being a system engineer, we have to guess that Socket runs full duplex. That ( if true ) would tell us that the code may be reading and writing at the same time. If so, using synchronized in several places may fix ad hoc some difficulties while the problem is actually located.
- By rameshraj in forum NetworkingReplies: 2Last Post: 05-30-2008, 10:18 PM
- By Zosden in forum NetworkingReplies: 16Last Post: 05-27-2008, 04:55 PM
- By Java Tip in forum java.netReplies: 0Last Post: 04-07-2008, 08:09 PM
- By Java Tip in forum java.netReplies: 0Last Post: 04-07-2008, 08:05 PM
- By Eric in forum NetworkingReplies: 3Last Post: 12-01-2007, 09:09 PM