Results 1 to 2 of 2
  1. #1
    rameshraj is offline Member
    Join Date
    Dec 2007
    Posts
    42
    Rep Power
    0

    Thumbs up 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.

  2. #2
    Nicholas Jordan's Avatar
    Nicholas Jordan is offline Senior Member
    Join Date
    Jun 2008
    Location
    Southwest
    Posts
    1,018
    Rep Power
    8

    Default

    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.

Similar Threads

  1. Sending files over sockets!
    By rameshraj in forum Networking
    Replies: 2
    Last Post: 05-30-2008, 11:18 PM
  2. Sockets
    By Zosden in forum Networking
    Replies: 16
    Last Post: 05-27-2008, 05:55 PM
  3. An echo server using UDP sockets
    By Java Tip in forum java.net
    Replies: 0
    Last Post: 04-07-2008, 09:09 PM
  4. Sending Mail Using Sockets
    By Java Tip in forum java.net
    Replies: 0
    Last Post: 04-07-2008, 09:05 PM
  5. Help with Sockets
    By Eric in forum Networking
    Replies: 3
    Last Post: 12-01-2007, 09:09 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •