Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-02-2008, 02:40 PM
Member
 
Join Date: Dec 2007
Posts: 38
rameshraj is on a distinguished road
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.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 06-11-2008, 07:13 PM
Nicholas Jordan's Avatar
Senior Member
 
Join Date: Jun 2008
Location: Southwest
Posts: 430
Nicholas Jordan is on a distinguished road
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.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sending files over sockets! rameshraj Networking 2 05-30-2008 11:18 PM
Sockets Zosden Networking 16 05-27-2008 05:55 PM
An echo server using UDP sockets Java Tip java.net 0 04-07-2008 09:09 PM
Sending Mail Using Sockets Java Tip java.net 0 04-07-2008 09:05 PM
Help with Sockets Eric Networking 3 12-01-2007 09:09 PM


All times are GMT +3. The time now is 02:36 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org