Socket blocks -

Hi,
I wrote an application which uses a socket included in a class (to connect to another application)
Each time the "socket-"class is new initialised and finished by setting it null.
But uneven I received a
java.net.SocketException: Software caused connection abort recv failedwhen reading data from the socket.
myByte = (byte) in.read();      
...Does anyone know where the bug is? Is it the applications fault or the of "other-application" (which I connect to?)
Thanks in advance.
adicko

Hi,
when I open another port of the "sending-application" it works proberly. But the other port still works only for some varying time - and afterwards throws the described error.
     private Socket clientSocket = null;    
        private BufferedInputStream in = null;
     private BufferedOutputStream b = null;
        private void openStreams(String host, int port)
          clientSocket = new Socket(host, port);
          in = new BufferedOutputStream(clientSocket.getOutputStream());
          b = new BufferedInputStream(clientSocket.getInputStream());
     private ByteArrayOutputStream receiveData() throws Exception
          byte first = 0;
          byte[] tempBuffer = null;
          ByteArrayOutputStream d = null;
          this.stopp();
          myByte = (byte) in.read();      
          if(myByte  != -1)
               e = new byte[in.available() + 1];
               in.read(e, 1, e.length - 1);
               e[0] = myByte;
               d = new ByteArrayOutputStream(e.length+1);
               d.write(tempBuffer);
               d.flush();     
          return d;
     private void stop() throws Exception
          synchronized(Myclass.class)
               Myclass.class.wait(1000);
     }

Similar Messages

  • Writing to socket blocks

    Hello,
    writing to a socket blocks as soon as the send buffer is full. Is there something I can do to check whether there is enough space for the new data or can I convince the socket to throw an exception if the send buffer is full?
    Andreas

    So you've just doubled the number of threads. This doesn't square with your stated objective:
    Because the number of server threads is limited this is bad for the overall server performance if there are more of these faulty clients. In this case it would be much better to close the connection and get rid of the erroneous client.It really would be far better to use NIO for this. You can cut the number of threads to one, handle this situation much more easily without extra threads, handle more clients with the same hardware.
    OTOH it is quite a bit harder to program and get right.

  • How to catch "socket block on write"

    Hi,
    I'm writting a java socket multi-threading program. I need to detect the write blocks when I try to write to the socket. Is there any way that I can either catch a timeout exception or create a non-block writting. SetSoTimeout doesn't work for write. And I really don't want to create a writting thread and reading thread separately for each socket (I've got too much threads already).
    Can anyone help me with that? Thank you so very much!!!
    -Z

    When you write to a socket it can take time for the other computer to respond. On the internet it can take minutes. So that is how sockets work. If you want to time out before that then you are going to have to do it yourself.
    I've got too much threads alreadyThen you should use a thread pool.

  • Socket blocking on read operation while uploading zip file to the server

    I am trying to upload a zip file to the server
    Client thread creates the zip file ( of the modified files) and it even completes writing the data to the socket stream.
    Now if the server thread tries to read the same data from the stream, it blocks on read operation.
    While downloding the zip file from the server works fine.
    Thanks in advance

    You can use the URL object to upload it as multipart/form-data.
    http://forum.java.sun.com/thread.jspa?threadID=579720&messageID=3997264
    Or check out some of the file uploaders out there.
    http://www.google.nl/search?hl=nl&q=site%3Asun.com+upload+applet&btnG=Zoeken&meta=

  • How can I log the process id associated to a local socket blocked by the PF firewall?

    Hi,
    There seem to be a problem with mac OSX PF firewall logging capabilities.
    I am trying to find the process id associated with a connection attempt blocked by PF. I am replicating, in a way, the feature found in a commercial firewall caled "Little Snitch"
    This is the method I have tried so far:
    1- I wrote a new pf config file with a ruleset that blocks all outbound connection attempts and logs it (see my ruleset at the bottom)
    2- I create the pflog0 interface
    sudo ifconfig pflog0 create
    3- I load the new pf config file
    sudo pfctl -d && sudo pfctl -f ./mypf.conf && sudo pfctl -e
    4- I log the blocked packet and try to retrieve the process names
    sudo tcpdump -n -e -vvv -ttt -i pflog0 > mypf.log
    OR
    sudo tcpdump -n -s0 -w ./mypf.pcap
    Either way, none of my "mypf.log" or "mypf.pcap" files contains any information about the processes.
    Any idea how I could log the PID of the processes?
    ##my ruleset mypf.conf
    ##MACRO
    host_if = "en0"
    ##OPTIONS
    set loginterface $host_if
    set debug misc
    set skip on lo
    ##RULES
    #I dont want to log all incomming connection, I just want to block it by default
    block in all
    #I want to log all attempts from processes to establish a connection outside
    block out log (user) all

    Hmmm....
    Your story is familiar - many folks here are somewhat bewildered by the
    technology that keeps coming up in their faces when they think that this
    process should be a simple one.  It SHOULD be, but....
    SONY Reader software for your PC is designed to 'captivate' you so that
    your ereader will function well with their store.  It is, in essence, their
    way of managing your elibrary.  And it's proprietary to SONY.   You can add
    ebooks to it in a similar way that you can add them to ADE.  Since we're an
    ADE forum, I don't have those steps in my reference file - sorry.
    As you've explained it, DRM protection is really not the issue here.  ADE's
    way of managing the relationship between you and the ebook is to keep track
    of who did the original download in a small ID file embedded in the ebook.
    ADE is telling you that your husband downloaded the ebook in question, and
    that you're not able to read it with your own ID.  The SONY message is
    essentially the same thing, but in different and confusing wording, which
    makes you believe that DRM protection is getting in your way.  That's
    probably not true, because you're not getting a 'No Permission To Copy
    Here' message from ADE - their way of telling you that the digital rights
    assigned by the publisher, distributor or author will prevent you from
    making a copy.  Shame on SONY for confusing the issue!
    What you can try is to deauthorize ADE by using the CNTLSHIFTD keys
    together after it opens and is waiting for you to do something.  Then,
    close ADE.  When you reopen ADE, it will ask you to authorize it, and you
    can put your husband's ID in.  ADE now thinks you are your husband, and
    will let you access all of his ebooks.  You can copy them to your ereader
    at this point and then open them to read - assuming that there really is no
    DRM protection that prohibits the copy.
    There's more, but let's take this one step at a time, eh?
    ================

  • Problem reading all data from Synchronous Socket

    Hi,
    I have the task to implements an C# application which communicates with a SAP system via HTTP. My application should act as a HTTP Server to the SAP system. SAP sends documents (PDFs, Word-Docs, Tifs) through HTTP-Requests to my Server. Archive Link is SAP´s name for that HTTP interface.
    Currently I am using synchronous sockets to process the communication. So
    basically I do something like this:
            Thread th = new Thread(new ThreadStart(StartListenThreaded));
         th.Start();
    The method StartListenThread looks like this:
         private void StartListenThreaded()
                   IPAddress ipAddress = IPAddress.Parse("127.0.0.1");
                   IPEndPoint EndPoint = new IPEndPoint(ipAddress, port);
                   Socket ss = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
                   ss.Bind( EndPoint);
                   ss.Listen(20);
                   try
                        while(true)
                             Console.WriteLine("rnServer is waiting for a new connection..rn");
                             Socket sock = ss.Accept();
                             Console.WriteLine("Accepted connection form:"+sock.RemoteEndPoint);
                             Connection con = new Connection(sock);
                             Thread t = new Thread(new ThreadStart(con.ProcessOneRequest));
                             t.IsBackground=true;
                             t.Priority=ThreadPriority.BelowNormal;
                             t.Start();
                   catch (System.Exception e1)
                   {  Console.WriteLine("An Exception Occurred while Listening :" +e1.ToString()); }
    As mentioned above There are mostly some Word-Documents or PDF files send as the body of a request. So I need to parse the body and write the content to a file.
    Currently I use this code to accomplish that:
         while (true)
             if(socket.Available == 0)
              break;
                n = socket.Receive(bytes);
             if(n == 0)
               break;
             wr.Write(bytes,0,n); // wr is a BinaryWriter
    Now my problem is that this loop breaks before all data is received from the socket. That means it runs into the socket.Available == 0 case and ends, but there is still data available. How did I find that out? Well during debugging the code.
    With the debugger running and when stepping through the code, obviously leaves the SAP side more time to send its data.
    When doing some Console.WriteLine() after the loop with the socket.Receive() I get results > 0. So there is still data available.
    I am not asking an SAP question here. I am aware that the problem could also be on the SAP side. However I think it is a C# issue. Has anyone experienced similar problems with sockets? Am I doing something completely wrong in handling my socket? I also don´t think that I can use Asynchronous sockets beacuse I need to process incoming requests in a determined order.
    I have also tryed to turn off Blocking mode by setting socket.Blocking = false but I found out that I cannon use that because I need NetworkStream at some point in my application and NetworkStream does not work without blocking mode.

    I have evaluated several other possibilities before starting to implement HTTP on a socket basis. I only have this choice.
    I have had a detailed look at Cassini before, but since you mentioned it in your post I looked at it more closely and I think I found a solution for my Problem.
    Cassini uses some code like the following to poll for more data in a request. I am now using this mechanism in my application and it works fine.
              private int WaitForRequestBytes()
                   int availBytes = 0;
                   try
                        Console.WriteLine("socket.Available: " + socket.Available);
                        if (socket.Available == 0)
                             // poll until there is data
                             Console.WriteLine("Polling 100ms");
                             socket.Poll(100000 /* 100ms */, SelectMode.SelectRead);
                             if (socket.Available == 0 && socket.Connected)
                                  Console.WriteLine("Polling 1sec");
                                  socket.Poll(1000000 /* 1sec */, SelectMode.SelectRead);
                                  // socket.Poll(10000000 /* 10sec */, SelectMode.SelectRead);
                        availBytes = socket.Available;
                   catch
                   return availBytes;
    So thanks for putting me in the right direction.
    Mirco

  • Runtime.exec and ServerSocket for IPC...blocking problems

    I have built an IDE for assembling/deploying web applications.
    I am supporting a 'test' mode in the IDE where a compiled 'solution/application' is executed in a separate vm from the IDE using Runtime.exec. For the whole sandbox thing. Don't want a wayward application crashing my IDE.
    Naturally I want a way to communicate start/stop from the IDE to the running application. So sockets are my only choice. Calling process.destroy from my IDE won't invoke a shutdownhandler in the generated application's vm, and I want an orderly shutdown as the generated applications open resources/etc.
    When I execute the generated application from within the IDE the thread code that creates a server socket blocks in the ServerSocket constructor...why?
    When I execute the solution using 'java' outside of my IDE, I can set up a server socket and all works fine.
    My IDE is NEVER creating server sockets waiting for client connects...only the generated application does this. So it isn't a case of the IDE already listening for requests on the same port as the server/generated application.
    Proving the above is that I can manually start my generated application, start my ide, then invoke the menuitem from the IDE that writes a 'close' byte to the client's socket...and the running application DOES shut down.
    Any ideas?

    I have decided on a different approach.
    At first I thought...ok I have the ServerSocket on the wrong 'side'. I then put the ServerSocket code in the always-running IDE and the Socket code on the running/exec'd application. But still a hang on the running application when constructing the Socket.
    I decided instead to call Process.destroy on the running app.
    Given that generated app is running in a separate vm, when it shuts down via process.destroy from the ide...although vm shutdown hooks aren't called...I guess it's ok since a destroy of the vm will release all resources. Not as clean as I'd like though.
    Additionally, I cannot determine 'true' start of application as no socket notification can be done. I merely determine start after a Runtime.exec of jvm process. Subsequent errors in startup will merely be determined by the IDE in process.waitFor or process.exitValue.
    I was getting a wierd socket error when attempting my prior solutions...and not a lot on the web regarding this subject...all relevant posts seemed to be in German/from Germany. Odd. Would need my wife to translate! Mein gott!
    I guess I could've communicated from ide to Runtime.exec'd application via a generated file in filesystem...but this seemed cheesy. Sockets should've been used for ipc between java vms...or so I thought.

  • Events,firing,listening-GUI/Networking seperation.

    I'm having a little trouble finding info on how to write my own events, event listeners and then how to fire these events. Basically i want to listen on a socket for info and then fire an event. I want to have a JList listen for this event and update itself.
    I'm not sure if this is the best way to do it but I'd really be interested in any ideas or pointers to info on other ways this could be done.
    Cheers.
    -T

    1. By default, reading from a socket blocks, so the simplest thing to do is start a thread to do the reading. (I haven't checked the i/o facility for polling in 1.4, but that would help if you were listening to several sockets).
    2. Once you read some data, you need to update your ListModel. If you're using DefaultListModel, you're laughing because it manages its listener list and fires off events for you. But see point 4.
    3. If you are subclassing AbstractListModel, you would need to call the appropriate fire*() method whenever your model changes state.
    4. Watch out for Swing and threads. Listeners assume their being called in the EDT (Event Dispatch Thread). Typically, this means your socket reading thread uses SwingUtilities method invokeLater().
    --Nax

  • Can I close the connection after sending immediately on the server?

    I have a C/S program. On the server side, the process as following:
    1. accept (blocking)
    2. //a connection is established
    using a new socket to receive request data from client
    3. business processing ... (maybe several seconds)
    4. send response data to client
    5. close socket immediately
    6. listening continuely again
    The server side is running on linux and writed by Java, and client is running on windows and writed by C++ Builder.
    My problem is:
    1. if the server is running on windows, everything is OK.
    2. if the server is running on linux (that is exprcted), the client can not receive the response data from server, the client program said the connection is unavailable when he read from socket blockingly.
    3. if I add some delay, e.g. 500ms, between sending response and close the connection, the client can receive response normally.
    why above?
    thanks for help.
    Jack

    Sorry, long time to go away.
    package test.server;
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.net.ServerSocket;
    import java.net.Socket;
    public class EchoServer {
         private int port; // listened port
         private ServerSocket ssock; // the server's ip
         public EchoServer(String host, int port) {
              this.port = port;
              // Create a ServerSocket
              try {
                   ssock = new ServerSocket(port);
                   SocketAddress addr = new InetSocketAddress(host, port);
                   ssock.bind(addr);
              } catch (Exception ex) {
                   ex.printStackTrace();
              new HandleThread().start();
         public class HandleThread extends Thread {
              public int ntohl(byte[] bytes, int offset) {
                   int length1 = ((((int) bytes[offset + 0]) << 24) & 0xff000000);
                   int length2 = ((((int) bytes[offset + 1]) << 16) & 0x00ff0000);
                   int length3 = ((((int) bytes[offset + 2]) << 8) & 0x0000ff00);
                   int length4 = ((((int) bytes[offset + 3]) << 0) & 0x000000ff);
                   return length1 + length2 + length3 + length4;
              public void run() {
                   InputStream in = null;
                   OutputStream out = null;
                   try {
                        while (true) {
                             System.out.println("Start Listening...  [" + port + "]");
                             Socket clisock = ssock.accept();
                             //clisock.setSoLinger(true, 1);
                             System.out.println( "SOLinger:" + clisock.getSoLinger());
                             try {
                                  System.out.println("Accepted Client Socket...  [" + clisock + "]");
                                  in = clisock.getInputStream();
                                  out = clisock.getOutputStream();
                                  // receive four bytes length
                                  byte[] lenbuff = new byte[4];
                                  in.read(lenbuff, 0, 4);
                                  int len = ntohl(lenbuff, 0);
                                  byte[] buff = new byte[len];
                                  in.read(buff, 0, len);
                                  System.out.println("Received length&#65306;" + len + "  " + new String(buff));
                                  Thread.sleep(1000);
                                  out.write(lenbuff);
                                  out.write(buff);
                                  out.flush();
                                  //Thread.sleep(500);
                                  System.out.println("Send finished&#12290;");
                             } catch (Exception ex) {
                                  ex.printStackTrace();
                             } finally {
                                  if (in != null) {
                                       try {
                                            in.close();
                                       } catch (Exception ex) {
                                  if (out != null) {
                                       try {
                                            out.close();
                                       } catch (Exception ex) {
                                  if (clisock != null) {
                                       try {
                                            long time00 = System.currentTimeMillis();
                                            clisock.close();
                                            System.out.println( "close socket&#65306;[" + (System.currentTimeMillis() - time00) + "]");
                                       } catch (Exception ex) {
                   } catch (Exception ex) {
                        ex.printStackTrace();
         public static void main(String[] args) throws Exception {
              if( args.length == 2 ) {
                   new EchoServer(args[0], Integer.parseInt(args[1]));
              } else if( args.length == 2 ) {
                   new EchoServer("127.0.0.1", Integer.parseInt(args[0]));
              } else {
                   new EchoServer("127.0.0.1", 16000);
    }In my application, the package is following:
    length(4bytes) + data
    I have a simple WinSocket Client, send data to this server and receive the response,the sending is OK, Server can receive all messages.But when client is ready to receive data, the winsock call return WSAECONNRESET(10054).
    If I uncomment "Thread.sleep(500);", it means wait some time before close socket, the client can receive all response data.
    why?

  • Messenger Server & NIO

    Hello!
    I have to implement a messenger server and I need some help.
    I haven't decided yet what to use: traditional Socket (blocking) or NIO. Using Sockets I can send and receive objects (part of the protocol), but I know that SocketChannel does't allow object transmision (it would be a blocking system violation).
    I am waiting your suggestions.
    Thank you!

    Hi,
    I have implemented a NIO server that reads and writes objects delimited by a packet header and length. There is no problem with that. Just write a class that scans for packages, and once a complete package is found you extract the object bytes and uses them as a source for an ObjectInputStream.
    /Kaj

  • Ipod is saying it's charged all the time, and won't connect at all to comp

    ok, so i have the white ipod nano, the first ones, and it's saying that it's charged all the time. you know the plug sign in the battery at the top of the screen, it's like that permanently!? and the only time when it's not showing it, is when the USB lead and the block charger that goes into the plug sockets is connected to it, which seems completly ridiculous i know, but yeh. and so when i want to connect it to the computer (obviously having to remove the socket block charger from the lead in order to connect to the USB port), it says it's charging again, and the computer doesn't recognise it whatsoever. anyone know how to sort this out, or any techniques to get the computer to connect to the ipod!?
    it's really getting on my nerves. i know my ipod is very old haha, but i hate the new ipods and i've been trying to rekindle it's life on many occasions haha
    pleease help, and suggestions would be very much appreciated!!
    xxx

    Try:
    - Reset the iPod. Nothing will be lost
    Reset iPod touch: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Reset all settings
    Go to Settings > General > Reset and tap Reset All Settings.
    All your preferences and settings are reset. Information (such as contacts and calendars) and media (such as songs and videos) aren’t affected.
    - Restore from backup
    - Restore to factory settings/new iPod.
    - Make an appointment at the Genius Bar of an Apple store.
    Apple Retail Store - Genius Bar
    or maybe this:
    Try:
    - iOS: Not responding or does not turn on
    - Also try DFU mode after try recovery mode
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings
    - If not successful and you can't fully turn the iPod fully off, let the battery fully drain. After charging for an least an hour try the above again.
    - If still not successful that indicates a hardware problem and an appointment at the Genius Bar of an Apple store is in order.

  • Problem with blocking socket.getInput/Output stream :-(

    Hi there!
    I have a typical client/server application and the problem, that opening the streams leads to clocking behaviour.
    This is how I open the streams on the server-side
    sock = ssock.accept();
    outStream = new ObjectOutputStream(new BufferedOutputStream(sock.getOutputStream()));
    inStream = new ObjectInputStream(new BufferedInputStream(sock.getInputStream()));and this is how I open it on the client-side:
            Socket sock = new Socket(host, port);
            outStream = new ObjectOutputStream(new BufferedOutputStream(sock.getOutputStream()));
            //inStream = new ObjectInputStream(new BufferedInputStream(sock.getInputStream()));If I leave the inStreeam-Statement uncommented, everything works fine, but as soon I try to catch the input-stream both, the server and the client-side block foreever.
    Any ideas whats wrong?
    Thank you in advance, lg Clemens

    Oh my god, what a brain-dead java-designer played with the thought tha creating a ObjectOutputStream does not lead to a flush() on the underlaying streams ???!!!
    Its easy if you know the way to go (same on both sides):
    1.) get the Outputstream / create the ObjectOutputStream
    2.) flush the ObjectOutputStream (so that the versioning-infp etc is exchanged)
    3.) create ObjectInputStream
    Step 2 is just extremly stupid in my eyes!
    lg Clemens

  • Blocking socket is not blocking.

    Hello
    I'm using the java.net.Socket class in JDK1.4 and hope that the read() on InputStream will block until there is data.
    However, the call to read() is not blocking but return me the end-of-stream symbol (-1). Because I want it to block (no timeout set) to save CPU time, how I do. Following, please find a code-example:
    public class Server implements Runnable {
    private java.net.Socket clientSock;
    public Server(java.net.Socket Sock) {
    clientSock = Sock;
    new Thread(this).start();
    public void run() {
    try { while (true) { clientSock.getInputStream.read(); }
    } catch (Exception Ex) { /* Never occur */ }
    public static final void main(String args[]) {
    try {
    java.net.ServerSocket servSock = new java.net.ServerSocket(54321);
    while (true) { new Server(servSock.accept()); }
    } catch (Exception Ex) { /* Never occur */ }
    This example takes 100% CPU load on my machine as soon as there is one connection. Why? Broken JDK?

    Try putting a sleep call in your loop...otherwise this single thread will take up all you CPU and will not yeild to the other threads. Set you SLEEP_TIME based on how long you want the thread to sleep before polling for data on the socket...
    try {
    while (true) {
    clientSock.getInputStream.read();
    Thread.sleep(SLEEP_TIME);
    } catch (Exception Ex) { /* Never occur */ }
    Hello
    I'm using the java.net.Socket class in JDK1.4 and hope
    that the read() on InputStream will block until there
    is data.
    However, the call to read() is not blocking but return
    me the end-of-stream symbol (-1). Because I want it to
    block (no timeout set) to save CPU time, how I do.
    Following, please find a code-example:
    public class Server implements Runnable {
    private java.net.Socket clientSock;
    public Server(java.net.Socket Sock) {
    clientSock = Sock;
    new Thread(this).start();
    public void run() {
    try { while (true) {
    ) { clientSock.getInputStream.read(); }
    } catch (Exception Ex) { /* Never occur */ }
    public static final void main(String args[]) {
    try {
    java.net.ServerSocket servSock = new
    = new java.net.ServerSocket(54321);
    while (true) { new Server(servSock.accept()); }
    } catch (Exception Ex) { /* Never occur */ }
    This example takes 100% CPU load on my machine as soon
    as there is one connection. Why? Broken JDK?

  • NIO sockets - cant get it to block!

    Hi,
    I'm trying to use NIO sockets in a program which sends data to a socket on another machine. I want it to block so that it must wait for a response before it continues. However this doesnt happen! I used Ethereal to see the packets being sent and recieved and the socket clearly doesnt block. Am I correct in thinking that NIO sockets are configured to block by default? I even tried using the configureBlocking(true) method to make sure but it still didnt block. Can anyone shed some light onto why this could be happening? Has this happened to anyone else?
    Cheers

    thomfost wrote:
    I've tried using regular I/O but its a bit too slow for what I need, im trying to see if using NIO improves this.Well you can stop now because it won't. NIO, as mentioned, is non-blocking IO, so a thread that is titled "NIO sockets - cant get it to block!" is not ultra promising. More importantly NIO will not make your IO "faster" by some magic. That's not what it does. It helps you write programs that scale because you don't need to have a thread dedicated to every client who connects to your system.
    At any rate you have multiple mistakes here which suggest the other slowness problem you refer to is a logical problem in your code. So why don't you tell us about that instead?

  • Handling socket exception - Retrying a "try" block

    I have a program which attempts to retrieve an object through a socket. However sometimes I get the following exception:
    java.net.SocketException: Connection reset
    This is a problem as I need the object to continue program execution.
    An overview of the code is:
    try {
                UrlServerObject crawlUrlObj = getUrlToCrawl();
                // Download webpage at the url returned by getUrlToCrawl()
                webpage = loadPage(crawlUrlObj);
    catch(java.net.SocketException ex) {
              System.err.println("An exception occurred.\n" +
                        "The exception was: " + ex.toString());
            }The getUrlToCrawl() method simply opens a socket a communicates with a server which sends back an object.
    My question is what is the best way to catch the exception and "retry" the complete "try" block until an object is read?
    Thanks

    When you say a loop, do you mean something along the
    lines of:
    boolean gotUrl = false;
    while(!gotUrl) {
    UrlServerObject crawlUrlObj = getUrlToCrawl();
    if(crawlUrlObj != null) gotUrl = true;
    }The exception would be thrown in the catch block
    still though?getUrlToCrawl is presumably the code you originally posted? Yep, that's about the size of it. Although I wouldn't keep trying until you got a URL, you should consider the possibility that there isn't one, and deal with that. I'd try it a set number of times, and move on after that

Maybe you are looking for

  • Voice memos on iPhone automatically go to iTunes

    Every time I record a voice memo on my iPhone, it shows up in my music library in iTunes. SO I delete it. But is there a way to prevent it from showing up there in the first place?

  • Close open items and post balance

    Hi, Do we have any standard reports or programs which will consolidate all the customer open items. I mean clear all the open items and post a sperate transaction with new balance. This is not for fiscal year balance forwarding but has to be done eve

  • 64-bit Windows 7 on Boot Camp Problem

    I recently got my new Macbook Pro, 15" with Intel i7 inside. I installed Windows 7 64-bit in it through Boot Camp right after I got it. However, after installation, I found my Mac system takes far longer time to boot up than as before (Well, that "fa

  • Can I make a custom position for a region ?

    Hi guys, I am trying to place a region on a page using CSS attributes. I tried this thing: in the region header : <div style="width:300px;height:150px;position:absolute;left:100px;top:100px;"> in the footer: </dive>but the problem is that only the it

  • Out put determination

    Hi Gurus, I need to send an internal mail i.e. in sap office((SBWP - Workplace )after saving the sales order.can some one help me the settings Thanks Akhibha