RE: FromSocketToField

2000-12-14 Thread Xavier Bury

figures
Thanks Andu!

Now on to find what that Q3 server expects!

Merry Xmas to all!
Xavier

 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED]]On Behalf Of andu
 Sent: Thursday, December 14, 2000 8:41 PM
 To: [EMAIL PROTECTED]
 Subject: RE: FromSocketToField


 
 I did look it up, and like it, i tried to get first a read from
 the server.
 
 But then why do i get an error and what does that error mean?
 
 Should I look it up in the technet or is this a MetaCard error code?
 
 I've tried many times before with the write and neither got an answer...
 I know for sure it works cause a friend made it work...
 He wont give me his code so im trying...

 In what way it works, I still don't understand what you expect to
 read from a server as
 soon as you open a connection to it? Some servers (mail) acknowledge a new
 connection , others need some input.

 
  
  Andu,
  
  I tried and failed again...
  
  on mouseUp
put "" into fld "socketresult"
put fld "url" ":"fld "port" into theurl
open socket theurl with message "readmore"
  end mouseUp
  
  on readmore socketOpen
put "reading socket"  socketOpen
read from socket socketOpen for 1024 with message "dataHasArrived"
  end readmore
 
  What do you xpect to read from the socket? Try writing a request
  or something and *then
  read the reply. Someone posted a script here the other day for
  ftp uploads I think, look it
  up in the archives to see an example of comunication with ftp server.
 
  
  on dataHasArrived socketOpen, tData
beep
put "data has arrived"
put tData into fld "data"
Close socket socketopen
  end dataHasArrived
  
  all i get is
  SocketError:212.166.2.96:21 Error 10057 reading socket
  I tried port 21 FTP, 80 (HTTP)
  and 27961, 27963 (Quake 3 servers)
  
  and I get only errors 10057
  Im sure im missing something... can someone help?
  
  TIA
  Cheers,
  Xavier
  
   -Original Message-
   From: [EMAIL PROTECTED]
   [mailto:[EMAIL PROTECTED]]On Behalf Of andu
   Sent: Tuesday, December 12, 2000 5:20 PM
   To: [EMAIL PROTECTED]
   Subject: Re: FromSocketToField
  
  
   
   I have the following script in a btn:
   ---
   read from socket "127.0.0.1:9980" for 1024 with
   message "dataHasArrived"
  
   on dataHasArrived socketOpen, tData
   put tData into fld 1
   end dataHasArrived
  
   Also you can just do:
   read from socket "127.0.0.1:9980" for 1024
   put it into fld 1
  
   Remember to open the socket before reading from it and to close
   it when you are done
   reading.
  
   
   I click on the btn, then send some data from another
   stack to the recieving stack. How do I make the data
   appear in a fld in the receiving stack?
   
   From the reference:
   
   The "read from socket" command is used to read data
   from a socket. Sockets are always opened in binary
   mode and so any required data conversion must be done
   in scripts.
   
   Could anyone kindly supply one of the "scripts" that
   the reference mentions?
   
   Thank you, Michael Kann, [EMAIL PROTECTED]
   
   
   
   __
   Do You Yahoo!?
   Yahoo! Shopping - Thousands of Stores. Millions of Products.
   http://shopping.yahoo.com/
   
   Archives: http://www.mail-archive.com/metacard@lists.runrev.com/
   Info: http://www.xworlds.com/metacard/mailinglist.htm
   Please send bug reports to [EMAIL PROTECTED], not this list.
   
   .
  
  
   Regards, Andu
   ___
   [EMAIL PROTECTED]
  
   Archives: http://www.mail-archive.com/metacard@lists.runrev.com/
   Info: http://www.xworlds.com/metacard/mailinglist.htm
   Please send bug reports to [EMAIL PROTECTED], not this list.
  
  
  Archives: http://www.mail-archive.com/metacard@lists.runrev.com/
  Info: http://www.xworlds.com/metacard/mailinglist.htm
  Please send bug reports to [EMAIL PROTECTED], not this list.
  
  .
 
 
  Regards, Andu
  ___
  [EMAIL PROTECTED]
 
  Archives: http://www.mail-archive.com/metacard@lists.runrev.com/
  Info: http://www.xworlds.com/metacard/mailinglist.htm
  Please send bug reports to [EMAIL PROTECTED], not this list.
 
 
 Archives: http://www.mail-archive.com/metacard@lists.runrev.com/
 Info: http://www.xworlds.com/metacard/mailinglist.htm
 Please send bug reports to [EMAIL PROTECTED], not this list.
 
 .


 Regards, Andu
 ___
 [EMAIL PROTECTED]

 Archives: http://www.mail-archive.com/metacard@lists.runrev.com/
 Info: http://www.xworlds.com/metacard/mailinglist.htm
 Please send bug reports to [EMAIL PROTECTED], not this list.



Archives: http://www.mail-archive.com/metacard@lists.runrev.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to [EMAIL PROTECTED], not this list.




RE: FromSocketToField

2000-12-14 Thread Xavier Bury

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 var2crcr"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/metacard@lists.runrev.com/
 Info: http://www.xworlds.com/metacard/mailinglist.htm
 Please send bug reports to [EMAIL PROTECTED], not this list.



Archives: http://www.mail-archive.com/metacard@lists.runrev.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to [EMAIL PROTECTED], not this list.




RE: FromSocketToField

2000-12-13 Thread Xavier Bury

Andu,

I tried and failed again...

on mouseUp
  put "" into fld "socketresult"
  put fld "url" ":"fld "port" into theurl
  open socket theurl with message "readmore"
end mouseUp

on readmore socketOpen
  put "reading socket"  socketOpen
  read from socket socketOpen for 1024 with message "dataHasArrived"
end readmore

on dataHasArrived socketOpen, tData
  beep
  put "data has arrived"
  put tData into fld "data"
  Close socket socketopen
end dataHasArrived

all i get is 
SocketError:212.166.2.96:21 Error 10057 reading socket
I tried port 21 FTP, 80 (HTTP)
and 27961, 27963 (Quake 3 servers)

and I get only errors 10057
Im sure im missing something... can someone help?

TIA
Cheers,
Xavier

 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED]]On Behalf Of andu
 Sent: Tuesday, December 12, 2000 5:20 PM
 To: [EMAIL PROTECTED]
 Subject: Re: FromSocketToField
 
 
 
 I have the following script in a btn:
 ---
 read from socket "127.0.0.1:9980" for 1024 with
 message "dataHasArrived"
 
 on dataHasArrived socketOpen, tData
 put tData into fld 1
 end dataHasArrived
 
 Also you can just do: 
 read from socket "127.0.0.1:9980" for 1024
 put it into fld 1
 
 Remember to open the socket before reading from it and to close 
 it when you are done
 reading.
 
 
 I click on the btn, then send some data from another
 stack to the recieving stack. How do I make the data
 appear in a fld in the receiving stack?
 
 From the reference:
 
 The "read from socket" command is used to read data
 from a socket. Sockets are always opened in binary
 mode and so any required data conversion must be done
 in scripts.  
 
 Could anyone kindly supply one of the "scripts" that
 the reference mentions?
 
 Thank you, Michael Kann, [EMAIL PROTECTED]
 
 
 
 __
 Do You Yahoo!?
 Yahoo! Shopping - Thousands of Stores. Millions of Products.
 http://shopping.yahoo.com/
 
 Archives: http://www.mail-archive.com/metacard@lists.runrev.com/
 Info: http://www.xworlds.com/metacard/mailinglist.htm
 Please send bug reports to [EMAIL PROTECTED], not this list.
 
 .
 
 
 Regards, Andu 
 ___
 [EMAIL PROTECTED]
 
 Archives: http://www.mail-archive.com/metacard@lists.runrev.com/
 Info: http://www.xworlds.com/metacard/mailinglist.htm
 Please send bug reports to [EMAIL PROTECTED], not this list.
 

Archives: http://www.mail-archive.com/metacard@lists.runrev.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to [EMAIL PROTECTED], not this list.




FromSocketToField

2000-12-12 Thread michael kann

I have the following script in a btn:
---
read from socket "127.0.0.1:9980" for 1024 with
message "dataHasArrived"

I click on the btn, then send some data from another
stack to the recieving stack. How do I make the data
appear in a fld in the receiving stack?

From the reference:

The "read from socket" command is used to read data
from a socket. Sockets are always opened in binary
mode and so any required data conversion must be done
in scripts.  

Could anyone kindly supply one of the "scripts" that
the reference mentions?

Thank you, Michael Kann, [EMAIL PROTECTED]



__
Do You Yahoo!?
Yahoo! Shopping - Thousands of Stores. Millions of Products.
http://shopping.yahoo.com/

Archives: http://www.mail-archive.com/metacard@lists.runrev.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to [EMAIL PROTECTED], not this list.




Re: FromSocketToField

2000-12-12 Thread michael kann

Thanks Andu, I appreciate it.

---Michael Kann wrote:

I have the following script in a btn:

read from socket "127.0.0.1:9980" for 1024 with
message "dataHasArrived"

I click on the btn, then send some data from
another stack to the recieving stack. How do I make
the data appear in a fld in the receiving stack?

---Andu answered almost immediately:

 on dataHasArrived socketOpen, tData
 put tData into fld 1
 end dataHasArrived
 
 Also you can just do: 
 read from socket "127.0.0.1:9980" for 1024
 put it into fld 1
 
 Remember to open the socket before reading from it
 and to close it when you are done
 reading.
 
 


__
Do You Yahoo!?
Yahoo! Shopping - Thousands of Stores. Millions of Products.
http://shopping.yahoo.com/

Archives: http://www.mail-archive.com/metacard@lists.runrev.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to [EMAIL PROTECTED], not this list.