Need solution for opening multiple connection to server in parallel

Hi..
I have used URL and URLConnectin classes to open connection to server,
and i used URLConnection.getInputStream( ) to download HTML pages.
Now my requirement is to open more than one connecton to single HTML document and download the file in parallel.
for example, if the HTML file size is 60KB..then i open three connection and
connection 1 downloads first 20KB
connection 2 downloads second 20KB
connection 3 downloads final 20KB
all the above should be done in parallel....by threading or else..
first of all i want to know is it possible to do the above in java?
anybody having solution for the above requirement?
venu

hi,
i too have the same problem
actually i am designing a download manager ,and had the same problem
that how to put multiple threads for doing it ,,,,
have u got solution for it..
if so please help me..
my mail id is [email protected]
i want help in designing the download manager
can any one help me out plzzzzzzzzzzzzzz
bye

Similar Messages

  • Single jdbc connection opens multiple connections to sql server

    Hello!
    I'm having a bad problem, because one jdbc connection opens multiple connections to the sql server. I'm working with the open source jdbc driver jtds and the ms sql server. Because I'm using temporary tables that are only visible to one database connection, my code doesn't work. Is this a bug in jtds or is this the normal behaviour of a java.sql.Connection?
    Here a code example:
    Class.forName("net.sourceforge.jtds.jdbc.Driver");
    conn = DriverManager.getConnection(
    "jdbc:jtds:sqlserver://"+dbConnDef.getServer()+"/"+dbConnDef.getDatabase(),
    dbConnDef.getUserName(),
    dbConnDef.getUserPasswd()
    Statement stmt = conn.createStatement();
    stmt.executeUpdate("SET DATEFORMAT YMD");
    stmt.close();
    stmt = conn.createStatement();
    stmt.executeUpdate("CREATE TABLE #tmp (FieldA INT NOT NULL)");
    stmt.close();
    stmt = conn.createStatement();
    ResultSet rs = stmt.executeQuery("SELECT * FROM #tmp");
    stmt = conn.createStatement("SELECT FieldA AS sthElse FROM #tmp");
    ResultSet rs2 = stmt.executeQuery("SELECT * FROM #tmp");
    // the strange thing is, that this second query does NOT yet open a
    // new connection, but the next sql command does.
    stmt = conn.createStatement();
    stmt.executeUpdate("DROP TABLE #tmp");
    stmt.close();
    Why is it behaving that strange way? It is absolutely necessary, that EVERYTHING that I do with my connection is really done on the same connection to the SQL server! How can I force a java.sql.Connection not to open multiple sql-server-connections?
    It is very urgent, thus, PLEASE HELP!!!
    Thousand thanks in advance! Marco.

    ...but that means, that the jdbc driver I use, is not working properly, because it should work the following way (please correct me, if I misunderstood the concept):
    I create a Connection object which should represent exactly one physical connection to the database. Then I can create as many Statement instances by conn.createStatement() as I want. There should still exist only one physical connection.
    With each of my Statement objects, I can create one result set.
    This means, I should be able to create as many result sets as I want to with only one Connection object (and therefor one physical connection) by creating multiple Statements, right?!
    If this is correct, the concept is perfect for me and exactly as I'm used to it by other programming languages. Then, only my jdbc driver does not work properly which means I either have to replace it by another one or change it myself (it's open source).

  • Can we open multiple connections to APNS Feedback Server

    Hi,
    Is it recommended/allowed to open multiple connections to APNS feedback server to poll the bad tokens?
    The idea is to run a timer task (every hour) on a n application server which will poll the apns feedback server to retrieve the bad tokens and then close the connection every one hour from N app srevers.
    If it is allowed, can multiple parallel connection get the same bad device tokens connected/read at same time?

    You are literally correct in that IP addresses can be spoofed.
    But the same argument can be made about any single, known, form of security.
    If I know it is the fingerprint from your left index finger that is required ... I've no doubt I can break in if I want to badly enough. Sorry about the finger.
    Security comes from layering multiple, unknown, security measures.
    Mix invited nodes with a known userid
    SELECT sys_context('USERENV', 'OS_USER') FROM dual;
    and the hacker has to know both a valid IP address and who is supposed to be there.
    Now on top of that add the operating system information:
    SELECT sys_context('USERENV', 'TERMINAL') FROM dual;
    and it becomes a bit more difficult.
    Layer on a few more and it becomes exceedingly unlikely anyone will get in that doesn't belong there.

  • I downloaded Mozilla when I first got my Mac.Is it a better than Safari?I tried Safari and I did not care for it. So can I still use cmd t or cmd n for opening multiple sites?

    I downloaded Mozilla firefox when I first got my mac as I did not like safari.Thah being said,which is better? and lastly can I still use cmd t or cmd with firefox for opening multiple sites? Thanks,Ralph

    You need to visit this page and learn all about Firefox's awesome features, don't ignore the add-ons, toolbar>customize or persona's they really personalize Firefox.
    http://www.mozilla.org/en-US/firefox/central/
    Also you need to make sure your browser plugins are current for your whole machine, Safari included.
    http://www.mozilla.org/en-US/plugincheck/
    I hope one day Apple will make Safari as awesome as Firefox and allow the choice it has, but not today.

  • Need solution for the following sync error: "iTunes could not sync calendars to the iPad "iPad name" because an error occurred while sending data from the iPad"

    Need solution for the following sync error: "iTunes could not sync calendars to the iPad "iPad name" because an error occurred while sending data from the iPad"

    I want to add that I deleted all the old back-ups and created a new back-up without any issues except sync problem.

  • Failed to open HTTP connection to server--OBIEE11g

    Hi,
    Mistakenly my machine got restarted and after that when I tried to start OPMN services,its showing all the processes alive but after that ,while restarting BI services from windows
    its throwing an error of unexpectedly shutting down of services.
    My NQS log says:
    [nQSError: 12010] Communication error connecting to remote end point: address = 192.168.10.209; port = 80.
    [nQSError: 46119] Failed to open HTTP connection to server 192.168.10.209 at port 80.
    I have checked that IP is still same. What is the issue behind it?
    This is very urgent.I have already posted this issues many times but didn't get any response So please help.
    Regards,
    Rajeev khanna

    HI,
    I have checked Repository DB is up and while starting OPMN services from via cmd (command prompt), all components are showing up but still not able to login to EM,console and Analytics. As I have earlier mentioned that NQS server log is throwing the below error:
    [nQSError: 12010] Communication error connecting to remote end point: address = 192.168.10.209; port = 80.
    [nQSError: 46119] Failed to open HTTP connection to server 192.168.10.209 at port 80.
    Please suggest.

  • Need solution for solving TIME_WAIT in TCP/IP ports in Windows Server 2008 Standard Service Pack 2

    In one of our windows machine( OS : Windows Server 2008 Standard (Service Pack 2)-32bit), we are facing TIME_WAIT in all the TCP/IP ports and it is not getting closed.
    On analyzing the issue, we found solution for this from the below link,
    https://support.microsoft.com/en-us/kb/2553549
    In this page, we are able to get the hotfix for Windows Server2008 R2 SP1 but i can't able to get for  Windows Server 2008 Standard SP2(32bit). If we try to apply the hotfix vailable for SP1, it is showing "The update does not apply to your System".
    Kindly provide us the solution for solving TIME_WAIT issue in the machine. 
    OS Details : Microsoft Windows Server 2008 Standard
    Version : 6.0.6002 SP2 Build 6002
    System Type : 32 bit(x86-based PC)
    Awaiting for the response.
    Thank you,
    Pushpalatha.A

    Download correct version from Microsoft Update Catalog. Run it with elevated rights.
    M.

  • Need solution for multiple Firewire needs

    My new 27" 2011 imac will arrive next Monday. I'm now trying to define and solve all potential hurdles.
    I seek recommendations on how to best solve my need to attach 2 original  firewire cables, into this imac that only comes with 1 firewire 800 input. Both connectors are critical to my  work. One connector will turn hard to the right for about six feet to connect to my Digi02 audio interface. The other cable connects and turns hard to the left for 15 feet to connect to my Epson 2200 art printer. Both of the outboard equipment need the original firewire.
    I have considered daisy chaining the audio interface and the printer. Except they are on opposite sides of my studio, and I prefer NOT to use a 25 foot firewire cable between such critical peices of hardware.
    A better possibility may be a firewire hub, although it will probably also need adaptors for the different versions of firewire i need. That seems rather inelegant. Another possibility would be to get one USB to firewire adaptor and one firewire to 800 adaptor. Do these USB to firewire adaptors work OK? 
    Anyway, which of these methods would you recommend as my best choice? Are there other choices i haven't mentioned here?

    The guy is totally correctin his review.
    That is how FireWire works. The FireWire bus will run only as fast as the slowest device on the bus. So as soon as plug in a FW400 device, everything is then clocked down to 400FW.
    If you need to have both FW800 and FW400 devices running at their native speeds you need two FW busses each with their own controller.
    Because of the limited expansion capability of the iMac, I don't see any way for you to get around this limitation.
    If you get a Mac Pro then you could use a FW PCIe card for the second bus and controller.
    Allan

  • Need solution for this query

    i want solution for shape & append query as run in access for oracle
    RS.Open "SHAPE {select ID,MAX(Module_Name) AS MainMenu from USER_MODULE GROUP BY ID} APPEND ({select ID,NAME,USER_module.srno,iif(right(param_str,1)='P','ü','') as Allow,iif(left(param_str,1)='A','ü','') as Ins,iif(MID(param_str,2,1)='E','ü','') as Edit,iif(MID(param_str,3,1) = 'D','ü','') as Del,flag,CODE,NAME from USER_MODULE left join user1 on user1.srno=USER_module.srno where user_name='" & Master_Rst!USER_NAME & "' or user_name is null} RELATE ID TO ID) AS AA", G_CompCn, adOpenDynamic, adLockOptimistic

    If you are in migration from one DB to other - you should not go with one to one convertion.
    First understand the business requirment - whats working and how is it working and whats expected out of your new code etc.
    Then decide what to place and how using your new DB.
    There might not be one to one exact match in all DBs.
    Simple example if you find any connect by prior in oracle - can you replace it with simple SQL command in ACCESS / SQL SERVER as it is without any functions?

  • IPad Mail Creating Multiple Connections with Server

    I am trying to connect with my iPad Mail Client via POP3 to an externally hosted e-mail server. My problem is that the iPad apparently is trying to enable multiple connections to the e-mail server and the protection on the server then bans my IP as a suspected DOS attack. How can the iPad client be adjusted to disable it from making multiple connections?
    And, is anyone else having this problem?

    I found the solution. Fetch is set automatically and that is my problem. Need to change it to manual

  • Using secure tranport for making ssl connection with server using iPhone

    HI all,
    I need to estabilish a secured connection using tcp with sslv3 to the server. I tried using
    [inputStream setProperty:NSStreamSocketSecurityLevelKey forKey:NSStreamSocketSecurityLevelSSLv3];
    [outputStream setProperty:NSStreamSocketSecurityLevelKey forKey:NSStreamSocketSecurityLevelSSLv3];
    I have explained the problem in detail in the following link
    http://www.iphonedevsdk.com/forum/iphone-sdk-development/25721-creating-ssl-conn ection-using-sockets.html
    But it makes only a tcp connection wth the server and the server sends the "Connection Reset by peer " error.
    So I have planned to use Secure Tranport. But i didnt find a suitable sample code in the internet. I found a sample in apple 's docs. But thats too confusing. Any sample code available for making tcp with ssl connection with the server ????
    Regards,
    Mohammed Sadiq.

    You must select if you use certificates for the SSL.
    If you are not, here is an example
    // server is the ip address for the server and hostport the port to use
    CFReadStreamRef readStream = NULL;
    CFWriteStreamRef writeStream = NULL;
    CFStreamCreatePairWithSocketToHost(kCFAllocatorDefault, (CFStringRef ) server, hostport, &readStream, &writeStream);
    if (readStream && writeStream) {
    CFReadStreamSetProperty(readStream, kCFStreamPropertyShouldCloseNativeSocket , kCFBooleanTrue);
    CFWriteStreamSetProperty(writeStream, kCFStreamPropertyShouldCloseNativeSocket, kCFBooleanTrue);
    iStream = (NSInputStream *)readStream;
    [iStream retain];
    [iStream setDelegate:self];
    oStream = (NSOutputStream *)writeStream;
    [oStream retain];
    [oStream setDelegate:self];
    if (Iwill_use_ssltoday == true)
    int res1 = [iStream setProperty:NSStreamSocketSecurityLevelNegotiatedSSL forKey:NSStreamSocketSecurityLevelKey];
    int res2 = [oStream setProperty:NSStreamSocketSecurityLevelNegotiatedSSL forKey:NSStreamSocketSecurityLevelKey];
    NSLog(@"SEC TEST %d %d",res1,res2);
    NSDictionary *settings = [[NSDictionary alloc] initWithObjectsAndKeys:
    [NSNumber numberWithBool:YES], kCFStreamSSLAllowsExpiredCertificates,
    [NSNumber numberWithBool:YES], kCFStreamSSLAllowsAnyRoot,
    [NSNumber numberWithBool:NO], kCFStreamSSLValidatesCertificateChain,
    kCFNull,kCFStreamSSLPeerName,
    // kCFStreamSocketSecurityLevelTLSv1, kCFStreamSSLLevel,
    nil];
    CFReadStreamSetProperty((CFReadStreamRef)iStream, kCFStreamPropertySSLSettings, (CFTypeRef)settings);
    CFWriteStreamSetProperty((CFWriteStreamRef)oStream, kCFStreamPropertySSLSettings, (CFTypeRef)settings);
    [iStream scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];
    [iStream open];
    [oStream scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];
    [oStream open];
    if (readStream)
    CFRelease(readStream);
    if (writeStream)
    CFRelease(writeStream);

  • Solution for scanning multiple pages from inside the form6i/10g

    Hi All,
    I need to scan multiple pages from Oracle forms (6i/10g) using a scanner which is scanning multiple pages per minute. Can any one post a solution for me.
    Hafeez

    here are the two ways I use to scan images.
    1) if the image is a single TIF image then d2kwutil can upload the image into a BLOB field on the database (but it is limited to only SINGLE-page TIFs).
    2) if the image is a single or multi-page PDF, then your forms client must copy the image to a filesystem location known by the database (where the filesystem location is a directory on the database), and then the database can import the image into a BLOB field within the database.
    either solutions work pretty fast for me (<10 seconds per image)
    Chris

  • Need Solutions for these Errors

    <b>Hello Group !
        How are you people there.Iam very much thank full to you people for your constant support.
    I need solution to these errors:</b>
         1.SID missing.
         2.Idocs Missing or No Idocs arrived from source
            System.
         3.Errors in the source system
         4.Missing messages at transfer rules or
           Update rules.
         5.Data sent but not received.
         6.Errors in the source system.
        Have a nice week end
        Vijay

    Hi,
    1. Missing SIDS : Mostly occurs due to missing master data or if error records are parked and not loaded susequently, or if Master data is not loaded before loading Transaction data. You need to fix these situations.
    2. Missing Idocs -Canbe due to idocs getting stuck, rfc connection failures, bad idocs, partner profies missing or deactivated. need to correct these errors on the source side.
    3.Source system errors - Jobs on source system failed or are slow.idoc errors. Source system crashing. Problems in generic extractions. Problems with update jobs. Data not getting posted to Delta queues. Data not coming through correctly after DS enhancement. Data posting errors to infostructures are some of the errors you'll face on the source system side.
    4. Missing messages again can be due to jobs being slow, processes being killed, or warning messages. Need to treat the warning messages or reset the job.
    5. Can be due to IDOC errors. Goto SM58 and push data packets from there on the source system side or due to IDOC errors.
    6. Same as 3.
    Cheers,
    Kedar

  • I have a solution for DKIM signing in Windows Server

    Hello.
    I have a solution for DKIM signing Keys in Windows Server 2008 and 2012
    Explanation will be long in the forum.
    If someone in need, please contact me by skype ID: sasgroupe
    Thank you

    Hi,
    Nice.
    But is it feature that header is not scroll horizontally ?
    Br, Jari

  • Firefox tabs open multiple connections to websites per tab.

    I keep getting blocked from certain websites for attempted DDoSing, I spoke to a webdev of one of the sites and it appears that each firefox tab connection is opening at least 10 connections to the website instead of one, which means I get blocked from the website regularly and can't connect to it.
    I have no plugins ie fasterfox or anything similar, however I do have TuneUp Utilites and I fear that that may have done something to cause my problem, however I am still unsure.
    == URL of affected sites ==
    http://www.MMOwned.com

    Ok, made the reset as told by cor-el, disabled also the Sync plugin thinking that FF may get back data from sync server, bu no joy...
    each time I start FF again, I get same bad ( for sure ) parameters in About:Config panel... is there a way to save them before restarting FF...? I found no info about this...
    My About:Config parameters are :
    network.http.max-connections;48
    network.http.max-connections-per-server;16
    network.http.max-persistent-connections-per-proxy;16
    network.http.max-persistent-connections-per-server;8
    network.http.pipelining;true
    network.http.pipelining.firstrequest;true
    network.http.pipelining.maxrequests;8
    network.http.proxy.pipelining;true
    network.http.request.max-start-delay;0
    I think request.max-start-delay is the one causing the most troubles...

Maybe you are looking for