Re: Messaging alert



Ulrich Schöbel wrote:
Hi Fernando,

take look at Tequila (not the drink, but http://wiki.tcl.tk/1243 ).
I think it might solve your problem in a very easy way.

Kind regards

Ulrich

Am Thu, 23 Feb 2006 18:53:13 -0500 schrieb Fernando Quinones:

Bryan Oakley wrote:
Even though the description is long, I'm not sure I understand it. Are you saying you have one tcl script that needs to tell another tcl script "open a message dialog"? If that's the case, use "send" to send a command from one script to the other. Or, use the comm package (http://mini.net/tcl/comm) to do the same thing.


I figured my poor English was the culprit of no answer! LOL!!!

Ok, let me have a second try.
I want a user to automatically notify me when he needs me to look at a text file that he has created and I want to notify the user back once I have seen and "processed" the file.

He uses a script that I have built to create the file and once he "sends" the file I should get a notification by a mean of a tk_message
or just flashing a message on my end of the application. I was hopping
that I could use sockets to create a connection back and forth in order
to send the message.

Fernando


The LanAdmin group will not install more GNU software so I am out of luck ussing either comm or tequila unless I can find a binary that I can just put in my root folder.

So far I have been able to create a socket and launch a tk_messageBox. However, this will happen with any connection. I want to be able to send a file name and other information thru the client socket to then process in the servers. Did I mention I want to have about 2 to 3 servers listening? These is what I have from the book.

############
# server
############


set listenSocket [socket -server Accept2 4512]

proc Accept2 {newSock addr port} {
global forever listenSocket

set choice [tk_messageBox -type yesno\
-icon info -title success\
-message "socket success, Stop server?"]

if {$choice == yes} {close $listenSocket}

}

vwait forever


############
# client
############



proc Socket_Client {host port timeout} {
global connected
after $timeout {set connected timeout}
set sock [socket -async $host $port]
fileevent $sock w {set connected ok}
vwait connected
if {$connected == "timeout"} {
return -code error timeout
} else {
return $sock
}
}


Socket_Client host_ip_address 4512 3500

If I got this straight at the client side, the socket is created and saved to sock. The fileevent statement set connected to ok when sock becomes writable. When connected changes value vwait stops waiting and the if statement returns the value of sock.

At the server side I am listening at the port and execute Accept2 when the socket is created. In the original proc the values of newsock addr and port where printed. However, I miss how do the newsock(the socket number) and host address are coming from.

The important question now is how do I send the information from the client to the server, lets say something like a filename. Where do I pack that information. Moreover, once I get that information on the server how do I send a message back to the client that I am done with processing the file.

I have more questions, but I need to understand this first. Thanks for all your help.
.



Relevant Pages

  • Re: Socket Exception
    ... In this case the server most likely rejected your ... connection. ... Each command is a new socket connection that is opened and closed ... /// Required designer variable. ...
    (microsoft.public.win32.programmer.networks)
  • Re: ASP.NET 2.0 - a newbie question
    ... Is there some experienced ASP.NET 2.0 developer, ... server that comes bundled Microsoft VWDE. ... A connection attempt failed because the ... connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& ...
    (microsoft.public.dotnet.framework.aspnet)
  • error when move web service from dev machine to test server
    ... I have a simple web service that I developed on my laptop that resides ... test server, & when I try to run it, I get the error "No connection could be ... No connection could be made because the target machine actively refused it ... Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState ...
    (microsoft.public.dotnet.framework.webservices)
  • Re: Messaging alert
    ... I was hopping that I could use sockets to create a connection back and forth in order to send the message. ... I want to be able to send a file name and other information thru the client socket to then process in the servers. ... fileevent $sock w ... At the server side I am listening at the port and execute Accept2 when the socket is created. ...
    (comp.lang.tcl)
  • Re: Strange server socket behaviour
    ... asynchronous server socket: ... I already have a perfectly working server that uses asynchronous sockets ... Why should the remote client close the connection? ... when a .NET client connects. ...
    (microsoft.public.dotnet.framework)