Re: Messaging alert
- From: Fernando Quinones <fernandoq@xxxxxxxxxxxxx>
- Date: Wed, 08 Mar 2006 10:49:23 -0500
Ulrich Schöbel wrote:
Am Wed, 08 Mar 2006 09:38:45 -0500 schrieb Fernando Quinones:The only message I have from you is dated 2/24, is that the one your are talking about?
Can anybody help with the trouble?
You probably stopped reading my previous posting too early.
Cameron, I did not went too far. Short of a binary I wont be able to install anything in my local machine. I can decompress folders but I cant compile anything as would on my late unix box. What you have in mind? Here is the original post:
Post 1
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
==> end of post1
Post 2
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.
==> end of post2
I guess I am not getting how can I send the string of data with the information I want to be procesed at the server and how to have the server reply back at due time with a "ok im done" message.
Fernando
.
- Follow-Ups:
- Re: Messaging alert
- From: slebetman@xxxxxxxxx
- Re: Messaging alert
- From: Bryan Oakley
- Re: Messaging alert
- References:
- Re: Messaging alert
- From: Fernando Quinones
- Re: Messaging alert
- From: Ulrich Schöbel
- Re: Messaging alert
- From: Cameron Laird
- Re: Messaging alert
- From: Fernando Quinones
- Re: Messaging alert
- From: Ulrich Schöbel
- Re: Messaging alert
- Prev by Date: Re: Messaging alert
- Next by Date: retrieve "puts" command result from C
- Previous by thread: Re: Messaging alert
- Next by thread: Re: Messaging alert
- Index(es):
Relevant Pages
|