No worrries.

You could also utilize the other ServerSocket methods to check if the socket
is bound to an IP address yet, and if so - could do various things, or just
report it back to you manual tool.

Just some extra thoughts ;o)

Mark

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Phil Evans
Sent: Monday, 19 April 2004 6:41 PM
To: CFAussie Mailing List
Subject: [cfaussie] Re: Killing a cd scheduled task that is hung

Thanks Mark.

Some excellent food for thought! I'll do some experimenting and see what I
come up with.

Cheers,
Phil.

----- Original Message ----- 
From: "Mark M" <[EMAIL PROTECTED]>
To: "CFAussie Mailing List" <[EMAIL PROTECTED]>
Sent: Monday, April 19, 2004 4:59 PM
Subject: [cfaussie] Re: Killing a cd scheduled task that is hung


> Stupid question -
>
> What is to stop you from storing the ServerSocket in the application
scope, and
> writing a small script to run socket.close() on it manually?
>
> It MAY cause a IOException if something is currently being read by it, but
that
> should be no issue.
>
> That also beign said there is the
> public void setSoTimeout(int timeout)
>
> which will allow you to set the timeout for the accept() call on the
ServerSocket.
>
> Hope that helps.
>
> Mark
> ------------------------------------------------------------------
> [EMAIL PROTECTED]
> ICQ: 3094740
> Safe From Bees
> [ www.safefrombees.com ]
>
>
> Quoting Phil Evans <[EMAIL PROTECTED]>:
>
> > Hi Mark,
> >
> > > Once the connection is recieved, the process is shut down, and then it
> > continues on
> > > it's merry way?
> >
> > Not exactly - basically the process needs to run continuously.
> > The process logic is as follows:
> >
> >     Create tcpip port
> >
> >     keep_going = "Y"
> >     while keep_going
> >         listen for message
> >         process message
> >         acknowledge message
> >         if end flag set, then keep_going = "N" end if
> >     end while
> >
> >     close tcpip port.
> >
> >
> > The code for the socket creation is:
> >
> > function createsocket(port) {
> >  getsocket = CreateObject("java", "java.net.ServerSocket");
> >  getsocket.init(port);
> >  socket = getsocket.accept();
> >
> >  inputsr = CreateObject("java", "java.io.InputStreamReader");
> >  inputsr.init(socket.getInputStream());
> >
> >  input = CreateObject("java", "java.io.BufferedReader");
> >  input.init(inputsr);
> >
> >  printWriter = CreateObject("java", "java.io.PrintWriter");
> >  printWriter.init(socket.getOutputStream(), true);
> >  }
> >
> >
> > I'm not sure if any time outs can be incorporated in to the calls. Any
> > thoughts appreciated.
> >
> > Thanks,
> > Phil.
> >
> > ----- Original Message ----- 
> > From: "Mark M" <[EMAIL PROTECTED]>
> > To: "CFAussie Mailing List" <[EMAIL PROTECTED]>
> > Sent: Monday, April 19, 2004 4:10 PM
> > Subject: [cfaussie] Re: Killing a cd scheduled task that is hung
> >
> >
> > > Phil,
> > >
> > > I'm not sure how to cancel the schedules service once it is already
> > running -
> > >
> > > However, maybe we could see some code? What technology are you using?
> > >
> > > How are you creating the open socket? is it possible to time the
socket to
> > close
> > > given a certain time period?
> > >
> > > I make the assumption that the socket is opened, and waits for the
> > incoming
> > > connection.
> > >
> > > Once the connection is recieved, the process is shut down, and then it
> > continues on
> > > it's merry way?
> > >
> > > Is this correct?
> > >
> > > Mark
> > > ------------------------------------------------------------------
> > > [EMAIL PROTECTED]
> > > ICQ: 3094740
> > > Safe From Bees
> > > [ www.safefrombees.com ]
> > >
> > >
> > > Quoting Phil Evans <[EMAIL PROTECTED]>:
> > >
> > > > Hi All,
> > > >
> > > > I have a task running under the CF scheduler that creates a TCP/IP
port,
> > and
> > > > handles messages that are sent from another process.
> > > >
> > > > About once a week a network outage at the client site will cause the
> > process
> > > > to hang. The process still exists, the TCP/IP port exists, but the
> > process
> > > > ceases to function.
> > > > I have a shut down feature built into the software based on flag
> > checking,
> > > > but as the process is hung, it can't check the flag and end
normally.
> > > >
> > > > If they restart the cfmx application service, this kills the
process,
> > > > releases the port, and the process can then be restarted
successfully.
> > > >
> > > > Is there any way (under windows CFMX) that I can find and kill a
process
> > > > without having to kill all CF processing by restarting the service?
> > > >
> > > > Thanks,
> > > > Phil.
> > > >
> > > >
> > > > ---
> > > > You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
> > > > To unsubscribe send a blank email to
> > [EMAIL PROTECTED]
> > > >
> > > > MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
> > > > http://www.mxdu.com/ + 24-25 February, 2004
> > > >
> > > >
> > > >
> > >
> > > ---
> > > You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
> > > To unsubscribe send a blank email to
> > [EMAIL PROTECTED]
> > >
> > > MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
> > > http://www.mxdu.com/ + 24-25 February, 2004
> > >
> >
> >
> > ---
> > You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
> > To unsubscribe send a blank email to
[EMAIL PROTECTED]
> >
> > MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
> > http://www.mxdu.com/ + 24-25 February, 2004
> >
> >
> >
>
> ---
> You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
> To unsubscribe send a blank email to
[EMAIL PROTECTED]
>
> MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
> http://www.mxdu.com/ + 24-25 February, 2004
>


---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]

MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004





---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]

MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004

Reply via email to