www.virtualacorn.co.uk/forum

For support and advice on VirtualAcorn products
Forums now closed. This is an HTML only record of the content.
HTML version of Forum generated Thursday 24th May 2018

All times are UTC [ DST ]




Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Messages - computer to computer
PostPosted: Fri May 08, 2009 8:25 am 
Offline

Joined: Wed Oct 24, 2007 6:29 pm
Posts: 124
Location: West Lancashire
I am looking for a method of sending multi-byte messages between RiscOS computers (currently a mixture of real and virtual).

Wimp_SendMessage works fine between tasks on the one computer - but not between computers.

The one essential required feature is that the sending computer must not hang if the remote computer is not there.

I have looked at file sharing, FTP, HTTP but with no success at present. :(

_________________
John


Top
 Profile  
 
 Post subject: Re: Messages - computer to computer
PostPosted: Fri May 08, 2009 10:37 am 
Offline
Site Admin

Joined: Wed Oct 23, 2002 12:16 pm
Posts: 958
The method you need to use will depend on the type of connection between the two machines. Typically most machines would be connected via TCP/IP. Lets assume that you have two apps (one on each machine) that can communicate this way.

The app on machine A broadcasts a "Wimp" message to the app on machine B. The app on machine B then calls the "Wimp_SendMessage" on that particular machine.

Of course there are other options. If working between 2 real machines you could use a serial cable. I should point out that writing a "networking" system isn't trivial (I know because I wrote one to connect between 2 RISC OS machines via the serial ports)


Top
 Profile  
 
 Post subject: Re: Messages - computer to computer
PostPosted: Fri May 08, 2009 11:11 am 
Offline

Joined: Wed Oct 24, 2007 6:29 pm
Posts: 124
Location: West Lancashire
Quote:
The app on machine A broadcasts a "Wimp" message to the app on machine B. The app on machine B then calls the "Wimp_SendMessage" on that particular machine.
My Programmer's Reference Manual is only for RiscOS 2

Can you point me to something which defines the later version of Wimp_SendMessage.

What version of RiscOS do I need to to that? (The real machines are 3.1, 3.5 and 3.6.)

_________________
John


Top
 Profile  
 
 Post subject: Re: Messages - computer to computer
PostPosted: Fri May 08, 2009 11:54 am 
Offline
Site Admin

Joined: Wed Oct 23, 2002 12:16 pm
Posts: 958
You need to get hold of the RISC OS 3 PRMS. A copy of the RISC OS 6 PRMS is available on-line from somewhere on the RISCOS Ltd site (do a Google search).

However I think you have misunderstood. Wimp messages are local, they can't be broadcast to other machines. Hence my point about you needing apps on both machines. You will need your own protocol for sending messages between the two. When one app receives a message it would then need to "perform" that message on the local machine.

i.e. You can are going to have to write it all yourself in order to do what you want. Hence you can target it at any version of RISC OS you choose.


Top
 Profile  
 
 Post subject: Re: Messages - computer to computer
PostPosted: Fri May 08, 2009 1:52 pm 
Offline

Joined: Wed Oct 24, 2007 6:29 pm
Posts: 124
Location: West Lancashire
Quote:
I think you have misunderstood.
Correct. but, thanks anyway :)

I am now back to my original question? How do I send messages - computer to computer.

As you say - write it myself (or leave this topic open - hoping somebody has already done it)

_________________
John


Top
 Profile  
 
 Post subject: Re: Messages - computer to computer
PostPosted: Fri May 08, 2009 4:06 pm 
Offline
Site Admin

Joined: Wed Oct 23, 2002 12:16 pm
Posts: 958
Quote:
How do I send messages - computer to computer. As you say - write it myself (or leave this topic open - hoping somebody has already done it)


Lots of people have produced networking systems :D

At a very basic level I suppose you could send "data files" from one machine to another using ShareFS. The recieving machine could then "run" the file.


Top
 Profile  
 
 Post subject: Re: Messages - computer to computer
PostPosted: Fri May 08, 2009 5:52 pm 
Offline

Joined: Wed Oct 24, 2007 6:29 pm
Posts: 124
Location: West Lancashire
I have looked at using ShareFS. But hit a problem.
If the remote computer is not running, then ShareFS stops the local computer with an error box.

I have also looked at using SocketFS, but again it stops the local computer if the remote end is not running (although in this case, it does time out eventually). (even SocketFS in a task window stops)

Anything, which stops the local computer (however temporarily) is not good enough.

_________________
John


Top
 Profile  
 
 Post subject: Re: Messages - computer to computer
PostPosted: Sat May 09, 2009 12:37 pm 
Offline
Site Admin

Joined: Wed Oct 23, 2002 12:16 pm
Posts: 958
Then you will need to write your own background protocol that is non-blocking. This could be done as a WIMP task (if you aren't familar with writing modules).

Each "station" on the network would need to be polled, and would then need to respond to each poll to say if it is available. Your app would need to buffer these so it would know if a station was available.

It could then send the data to the app running on a particular station. This app could then convert the data to whatever is needed and execute the operation. This is how my serial based network system (SerialNET) used to work.

Ideally you want the same app that can receive and transmit running on each station - so we are talking about a peer to peer system.


Top
 Profile  
 
 Post subject: Re: Messages - computer to computer
PostPosted: Mon May 11, 2009 3:52 pm 
Offline

Joined: Wed Oct 24, 2007 6:29 pm
Posts: 124
Location: West Lancashire
OK. I understand the principle.

I also have some documentation for the SWIs (provided with !FreeNet)

I guess I will have to do some more reading - and then start coding.

_________________
John


Top
 Profile  
 
 Post subject: Re: Messages - computer to computer
PostPosted: Mon May 11, 2009 4:37 pm 
Offline
Site Admin

Joined: Wed Oct 23, 2002 12:16 pm
Posts: 958
That's the best idea. On the subject of reading materials, here is a link that might prove useful :D

http://www.riscos.com/support/developers/index.htm


Top
 Profile  
 
 Post subject: Re: Messages - computer to computer
PostPosted: Mon May 11, 2009 5:01 pm 
Offline

Joined: Wed Oct 24, 2007 6:29 pm
Posts: 124
Location: West Lancashire
Many Thanks :)

_________________
John


Top
 Profile  
 
 Post subject: Re: Messages - computer to computer
PostPosted: Fri Sep 17, 2010 1:10 pm 
Offline

Joined: Wed Oct 24, 2007 6:29 pm
Posts: 124
Location: West Lancashire
Two years downstream and I now have a working update.

As Aaron suggested, writing a special filing system, did the trick; except that I did not write it.

I let somebody else do that and used the SocketFS module by Roger Gammans (Aug 1997).

On the sending computer, the following simple code will send a message to port 80 on IP address 10.1.128.12

Code:
    Web%=OPENUP("socketfs::tcp.$.10/1/128/12\80")
    A$ = "GET /message.cgi?message=messagetext"
    BPUT#Web%,A$
    CLOSE#Web%: REM no need to wait for reply


On the receiving computer, a simple webserver CGI script, sends the message data to the receiving application using Wimp_SendMessage. I use !WebJames

Because SocketFS 'hangs' if the remote computer is not alive, I simply ran the above code in a Task Window; creating the task window on the fly to send the message.

_________________
John


Top
 Profile  
 
 Post subject: Re: Messages - computer to computer
PostPosted: Mon Sep 20, 2010 1:28 pm 
Offline
Site Admin

Joined: Wed Oct 23, 2002 12:16 pm
Posts: 958
That's a very neat solution to the problem.

ShareFS "hanging" (blocking everything) when there is no response was what I meant by saying that you would need a non blocking system. Using a Task Window to acheive a non blocking system is also a neat workaround.


Top
 Profile  
 
 Post subject: Re: Messages - computer to computer
PostPosted: Mon Jun 18, 2012 12:41 am 
Offline

Joined: Wed Oct 24, 2007 6:29 pm
Posts: 124
Location: West Lancashire
I have a further update to this. I did not say, explicitly, what software I used on the 'receiving' computer to accept the port 80 TCP/IP messages.

I am using !WebJames and a !WebJames style cgi script wriiten in Basic. The script simply decodes the message in the URL and then closes the HTTP session without sending any response. The 'message' is then broadcast to the receiving task as this saves the hassle of finding the receiving task handle, which changes when the task is re-started.

Any response required is simply done with another new message sent in the other direction. The original sender's IP address is obtainable with the original message, if needed.

It all works very reliably on VRPC and even seems to be very tolerant to broken network links etc. (and, of course, it works across the internet as well as within a local network.)

It is not so reliable on real Acorn computers which still seem to hang under some fault conditions. So the Risc PCs have now been consigned to the loft and everything uses VRPC. :)

_________________
John


Top
 Profile  
 
 Post subject: Re: Messages - computer to computer
PostPosted: Mon Oct 01, 2012 5:27 pm 
Offline

Joined: Wed Oct 24, 2007 6:29 pm
Posts: 124
Location: West Lancashire
A further update.

I wanted to try this on the Alpha build of Risc OS on the Raspberry Pi and found that SocketFS is not 32bit compatible.

So back to the drawing board and a bit of research later, I tried the Wget software. It worked perfectly and the good news is that it also works on VRPC.

So the code is even simpler
Code:
OSCLI("*Wget --spider --quiet http://10.0.128.12/message.cgi?message=messagetext")
As before, I run that in a task window.

_________________
John


Top
 Profile  
 
 
Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

   
cron
Forums originally Powered by phpBB © 2007 phpBB Group. Contents © 3QD Developments Ltd 2018 version no. 1.07