realbasic-nug
[Top] [All Lists]

Re: Server socket example?

To: REALbasic Network Users Group <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: Server socket example?
From: akosu <realbasic at pth-akosu dot nl>
Date: Mon, 31 Mar 2003 14:33:11 +0100
Alan,

In this case, create a new class and set it's superclass to TCPSocket. When you open the code window for that class then you will see that you can add code to the DataAvailable event. The difference is that the code is now in a different window.

Instead of instanciating TCPSockets from code, instanciate your own class instead.

Since the new class is not a control, it does not have the Window property (nor SELF) that refers to the Window that it belongs to. You might want to add a property to your own class that holds that reference. How you fill that property (either a public property that is set when instanciating or through a parameter of the new class's contructor) is a design choice.

For examples, you might want to look at other controls that can be instanciated by code, such as Timer or RBScript. The basic idea is the same.

Happy programming,
Eddy Walet
PTH

Alan Stenhouse wrote:

Hi all

I have a question... a serversocket example I have seen has the serversocket
attached to a window as well as 20 TCPSockets. Now I thought that we can
instantiate a Serversocket in code, and that it would automatically look
after the creation of the TCPsockets. But then do i need to create my own
DataAvailable events etc? Think I am totally missing something here... Would
appreciate another example if possible, have looked around the net without
much success...

TIA

Alan





---
A searchable archive of this list is available at:
<http://support.realsoftware.com/listarchives/search.php>

Unsubscribe:
<mailto:realbasic-nug-off at lists dot realsoftware dot com>

Subscribe to the digest: <mailto:realbasic-nug-digest at lists dot realsoftware dot com>
.


<Prev in Thread] Current Thread [Next in Thread>