Thanks Hassan (that's your 1st name i hope!)
Good show! Simple scripts are the best!
As for your question about reading multiple sockets,
it should be no problem at all. There are two ways to do it...
PreParsed: Open your sockets with different messages according to different
sockets (ip's and/or ports)
or
Post-parsed: With the same message, you could compare the ips or ports to
handle the different messages.
or
Merry-Parsed: You even have a third option to parse different talks/messages
between the client(s) and server(s) to do for example a mix of both ftp,
http and email or what have you...
or
Unparsable: Cotton sockets are better for snowboarding
Am i wrong? Other concepts?
Sun Tzu said, "there are five notes of music
yet their combinations are infinite"
Merry seasonings!
Dont drink and drive, you might spill!
Xavier
> Hi Xavier, here is the script i have learned and
> modified from a lot of what have been posted
> previously on this list. This is a great list with a
> lot of kind, cooperative helpful people. hope you can
> use it somehow. it works on a one machine(client) to
> a server test. haven't tried with more than that.
> let us/me know if you try it with more. (can anyone
> show how to do this with more than one open socket?)
>
> Here's how it works:
> The client send some data/text to the server, and get
> the message that the data has been/has not been
> received at certain time of the day. At the same
> time, the client will get to see back almost
> immediately the latest update of data on the server.
>
> The server reads/accept the the data/text that is sent
> by the client. What you do/process with the data/text
> is up to you then. It sent the latest update back to
> the client just to show that the new data has been
> added.
>
> Here's the script:
>
> on the client side:
>
> on mouseUp
> open socket to "1.1.1.1:8080" with message gotcha
> --change 1.1.1.1 to the appropriate server address
> end mouseUp
>
> on gotcha s
> put field "a" into var1
> (--text to be sent to server)
> write var1 & crlf & (the long time) to socket s
>
> (--reading feedback from the server)
> read from socket s until empty
> put it into field "b"
>
> if last line of field "b" = "RESULT OK"&&the date
> then
> put "Data sent successfully at:."&the long time
> after the last line of field "b"
> put "Looks like we are online at"&&(the long time)
> else
> answer "Looks like the server is not responding."
> end if
> close socket s
> end gotcha
>
>
>
> On the server side:
>
> on openCard
> accept connections on port 8080 with message
> "newconnect"
> if the result is not empty then put the result
> checkData
> end openCard
>
> on checkData
> put field 1 into field "b"
> send "checkData" to this card in 1 seconds
> end checkData
>
> on newconnect s
> read from socket s until empty
> (--text sent from the client)
> put it into fld 1
> put field 1 into var2
> write var2&cr&cr&"RESULT OK " && the date to socket
> s
> (--to show back to the client the latest update sent
> to the server)
> close socket s
> end newconnect
>
> feel free to add/modified and it will be great if it
> can be posted back to the list.
>
> cheers.-rosli
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Shopping - Thousands of Stores. Millions of Products.
> http://shopping.yahoo.com/
>
> Archives: http://www.mail-archive.com/[email protected]/
> Info: http://www.xworlds.com/metacard/mailinglist.htm
> Please send bug reports to <[EMAIL PROTECTED]>, not this list.
>
Archives: http://www.mail-archive.com/[email protected]/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to <[EMAIL PROTECTED]>, not this list.