Hi, Moses
Sure, can you send me the "working" socket example?
>> It seems to me that whoever is responsible for the socket program
>> needs to know more than the socket command.
>> The person needs to have the knowledge about the following
>
>Tricky in Java.
>
>> a) fileevent (get the callback for the client)
>
>These two have nothing to do with the socket command and they are
>already implemented in Jacl.
>
>> b) global
>> c) vwait
>
>Not sure what you mean.
>
I was talking about the examples in the chap 16 of the book, "Practical
Programming in Tcl and Tk".
e.g.
client example:
set sock [socket -async host port]
fileevent $sock w {set connected l] /*the fileevent will be notified
when the connection occurred */
global connected
vwait connected
/* the above example shows that there are some communications between
the socket and the fileevent */
server example:
set mainSocket [socket -server Accept 2540]
proc Accept {newSock addr port} }
puts "Accepted $newSock from $addr port $port"
}
vwait forever
/* the above example shows that there are some communication between the
server socket and the Accept(callback) functions. */
thanks
david
>From: Moses DeJong <[EMAIL PROTECTED]>
>To: david shen <[EMAIL PROTECTED]>
>CC: [EMAIL PROTECTED], [EMAIL PROTECTED]
>Subject: Re: [Tcl Java] Re: remote execution
>Date: Wed, 24 Mar 1999 19:31:13 -0600
>
>On Wed, 24 Mar 1999, david shen wrote:
>
>> Hi, Mo
>
>Those are the only socket commands but sockets can be used in Tcl
>just like any other file with the puts and gets command. They can
>also be used by the fconfigure command and the fileevent commands
>but these do not really matter in Jacl because there is no
>implementation for fconfigure or fileevent and Java does not support
>non blocking IO so it is a mute point. What should work is implementing
>the socket command (client or server or both) and doing blocking IO
>calls with gets and puts.
>
>> Can you tell me a little bit about the scope of the socket
programming?
>>
>> I read the tcl on-line help command.
>> There are 2 lines in the synopsis:
>>
>> socket ?options? host port
>> socket -server command ?options? port
>>
>> and 1 line in the configuration
>> The fconfigure command .
>
>The socket examples are not so hot. I can provide you with some
>"working" socket examples if you are interested.
>
>> I also read the socket programming(chap 16) from the book "Practical
>> Programming in Tcl and Tk". There are several examples about both
>> client sockets and server socket.
>
>Implementing the "socket" command would not be that hard because it
>is already implemented in C. It is just a matter of taking the C
>code and translating it to Java code.
>
>> It seems to me that whoever is responsible for the socket program
>> needs to know more than the socket command.
>> The person needs to have the knowledge about the following
>
>Tricky in Java.
>
>> a) fileevent (get the callback for the client)
>
>These two have nothing to do with the socket command and they are
>already implemented in Jacl.
>
>> b) global
>> c) vwait
>
>Not sure what you mean.
>
>later
>mo
>
>> d) callback command
>>
>> Am I correct?
>>
>> thanks
>>
>> david
>>
>>
>>
>>
>>
>>
>> >From: Moses DeJong <[EMAIL PROTECTED]>
>> >To: david shen <[EMAIL PROTECTED]>
>> >CC: [EMAIL PROTECTED], [EMAIL PROTECTED]
>> >Subject: [Tcl Java] Re: remote execution
>> >Date: Wed, 24 Mar 1999 17:52:31 -0600
>> >
>> >On Wed, 24 Mar 1999, david shen wrote:
>> >
>> >> Hi, guys
>> >
>> >That is a little tricky as Jacl does not have a finished
implementation
>> >of the socket command yet.
>> >
>> >> I would like to run tcl(Jacl) script file on the remote server and
>> >> then display the result on my machine.
>> >>
>> >> What would be the easiest way to to it?
>> >>
>> >> I would like to do the following:
>> >
>> >You could do this by creating a java socket object directly in Jacl
>> >using the java::* commands and then invoking the correct methods
>> >on them. After your Jacl server got a message it could then call
>> >intep.evalFile() and then write the result back over the network
>> >connection. That should not be too difficult. If you just want to
>> >"get it done" this would be the quickest way. If you have a little
>> >time to spare and you would like to help out you could implement
>> >the socket command in Jacl. This would be a much better "long term"
>> >solution as the socket command would become a supported part of
Jacl.
>> >I would be willing to provide as much help as I can.
>> >
>> >later
>> >Mo DeJong
>> >dejong at cs.umn.edu
>> >
>> >> 1) using either TCP/IP or RMI to pass the tcl script to the remote
>> >> machine
>> >> 2) The remote machine would do the following
>> >> a) interp.evalFile();
>> >> b) interp.getResult();
>> >>
>> >> 3) pass back the result from 2(b)
>> >>
>> >> 4) Is this the best way to do it or there are some other
>> alternatives?
>> >>
>> >> thanks for your help
>> >>
>> >> david
>> >> Get Your Private, Free Email at http://www.hotmail.com
>> >>
>> >> ----------------------------------------------------------------
>> >> The TclJava mailing list is sponsored by WebNet Technologies.
>> >> To subscribe: send mail to [EMAIL PROTECTED]
>> >> with the word SUBSCRIBE as the subject.
>> >> To unsubscribe: send mail to [EMAIL PROTECTED]
>> >> with the word UNSUBSCRIBE as the subject.
>> >> To send to the list, send email to '[EMAIL PROTECTED]'.
>> >> A list archive is at: http://www.findmail.com/listsaver/tcldallas/
>> >>
>> >
>> >----------------------------------------------------------------
>> >The TclJava mailing list is sponsored by WebNet Technologies.
>> >To subscribe: send mail to [EMAIL PROTECTED]
>> > with the word SUBSCRIBE as the subject.
>> >To unsubscribe: send mail to [EMAIL PROTECTED]
>> > with the word UNSUBSCRIBE as the subject.
>> >To send to the list, send email to '[EMAIL PROTECTED]'.
>> >A list archive is at: http://www.findmail.com/listsaver/tcldallas/
>> >
>>
>>
>> ______________________________________________________
>> Get Your Private, Free Email at http://www.hotmail.com
>>
>> ----------------------------------------------------------------
>> The TclJava mailing list is sponsored by WebNet Technologies.
>> To subscribe: send mail to [EMAIL PROTECTED]
>> with the word SUBSCRIBE as the subject.
>> To unsubscribe: send mail to [EMAIL PROTECTED]
>> with the word UNSUBSCRIBE as the subject.
>> To send to the list, send email to '[EMAIL PROTECTED]'.
>> A list archive is at: http://www.findmail.com/listsaver/tcldallas/
>>
>
>
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com
----------------------------------------------------------------
The TclJava mailing list is sponsored by WebNet Technologies.
To subscribe: send mail to [EMAIL PROTECTED]
with the word SUBSCRIBE as the subject.
To unsubscribe: send mail to [EMAIL PROTECTED]
with the word UNSUBSCRIBE as the subject.
To send to the list, send email to '[EMAIL PROTECTED]'.
A list archive is at: http://www.findmail.com/listsaver/tcldallas/