Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Wed Dec 11, 2019 5:18 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 14 posts ] 
Author Message
 Post subject: Creting a server...
PostPosted: Sun May 13, 2012 2:00 pm 
Offline

Joined: Sat May 19, 2007 6:01 am
Posts: 300
http://docs.realsoftware.com/index.php/ServerSocket
Quote:
ClientSocket is derived from TCPSocket and its constructor takes a ListBox and an Integer.

ClientSocket's Connected event is:


Where do I write the ClientSocket's Connected event!?


Top
 Profile  
Reply with quote  
 Post subject: Re: Creting a server...
PostPosted: Sun May 13, 2012 3:23 pm 
Offline
User avatar

Joined: Sun Aug 12, 2007 10:10 am
Posts: 1086
Location: Boiling Springs, SC
What kind of server are you creating? Web? Chat? Database?

_________________
Matthew A. Combatti
Real Studio 2012 r1.2

Visit Xojo Developer's Spot!
Systems I Use:
Windows XP/Windows Vista/Windows Server 2008 r2/Windows 7/Windows 8
Mac OSX 10.5/Mac OSX 10.6/Mac OSX Server/Ubuntu/Debian/Suse/Red Hat/
Windows Server 2011/CentOS 5.4 /ReactOS/SimOS

~All Xojo Compatible~


Top
 Profile  
Reply with quote  
 Post subject: Re: Creting a server...
PostPosted: Sun May 13, 2012 4:01 pm 
Offline

Joined: Sat May 19, 2007 6:01 am
Posts: 300
Well... Right now I just try to follow the example...

I have the book, and I try to create a web server, the simple kind.
But the book is little old and REALbasic has changed since the book was released.

I really wish to create the chat server, but I thought it was better to start with something more simple until I get the hang of it!
But the hang seems to be little more loose than I expected...


Top
 Profile  
Reply with quote  
 Post subject: Re: Creting a server...
PostPosted: Sun May 13, 2012 6:32 pm 
Offline
User avatar

Joined: Sun Aug 12, 2007 10:10 am
Posts: 1086
Location: Boiling Springs, SC
Here is a simple server created by Thom McGrath

http://thezaz.com/code/httpserver/

A chat server is quite simple..will return with an example for you :-)

_________________
Matthew A. Combatti
Real Studio 2012 r1.2

Visit Xojo Developer's Spot!
Systems I Use:
Windows XP/Windows Vista/Windows Server 2008 r2/Windows 7/Windows 8
Mac OSX 10.5/Mac OSX 10.6/Mac OSX Server/Ubuntu/Debian/Suse/Red Hat/
Windows Server 2011/CentOS 5.4 /ReactOS/SimOS

~All Xojo Compatible~


Top
 Profile  
Reply with quote  
 Post subject: Re: Creting a server...
PostPosted: Sun May 13, 2012 6:58 pm 
Offline
User avatar

Joined: Sun Aug 12, 2007 10:10 am
Posts: 1086
Location: Boiling Springs, SC
Here is a simple chat server/client in-one. Hope it helps. You will notice that very few lines of code are actually needed to have a working Client/Server :-) Let me know if you need any explanation or have any questions.

Source:
http://www.realstudiodevspot.com/demos/chat.rbp

_________________
Matthew A. Combatti
Real Studio 2012 r1.2

Visit Xojo Developer's Spot!
Systems I Use:
Windows XP/Windows Vista/Windows Server 2008 r2/Windows 7/Windows 8
Mac OSX 10.5/Mac OSX 10.6/Mac OSX Server/Ubuntu/Debian/Suse/Red Hat/
Windows Server 2011/CentOS 5.4 /ReactOS/SimOS

~All Xojo Compatible~


Top
 Profile  
Reply with quote  
 Post subject: Re: Creting a server...
PostPosted: Sun May 13, 2012 8:01 pm 
Offline

Joined: Fri Jan 06, 2006 3:21 pm
Posts: 12388
Location: Portland, OR USA
Eclipse wrote:
http://docs.realsoftware.com/index.php/ServerSocket
Quote:
ClientSocket is derived from TCPSocket and its constructor takes a ListBox and an Integer.

ClientSocket's Connected event is:


Where do I write the ClientSocket's Connected event!?


The Connected event will be in the ClientSocket subclass. Add a new Class to the project, name it ClientSocket, and set its Super to TCPSocket. Double click it to reveal the code editor for the class.


Top
 Profile  
Reply with quote  
 Post subject: Re: Creting a server...
PostPosted: Mon May 14, 2012 8:04 am 
Offline

Joined: Sat May 19, 2007 6:01 am
Posts: 300
simulanics wrote:
Here is a simple chat server/client in-one. Hope it helps. You will notice that very few lines of code are actually needed to have a working Client/Server :-) Let me know if you need any explanation or have any questions.

Source:
http://www.realstudiodevspot.com/demos/chat.rbp


Thank you very much for this piece of code! I will study. It seems pretty neat.
I don't want anything fancy... only the simple.

***
Excuse me, but did you get that to work!?
I changed port to 5500 and the IP to:
(Open)
DIM s as New TCPSocket
me.text= str(s.LocalAddress)

I always get Error #103 when connecting!

***
I think maybe later I wish also to have multiple connections... But maybe this solution is good enough for that!?
I mean, what's the point with a chat if there is only single connection!? : )


Top
 Profile  
Reply with quote  
 Post subject: Re: Creting a server...
PostPosted: Fri May 18, 2012 10:24 am 
Offline
User avatar

Joined: Fri Oct 28, 2005 7:05 am
Posts: 565
Location: Emsworth, UK
Eclipse wrote:
I always get Error #103 when connecting!


I haven't looked at the example code specifically.

Error 103 means Name Resolution Error and is documented under the SocketCore topic in the language reference. It means whatever value is in the .Address property of your socket object, is not recognised on the network. The .Address property should be set to the network address of the listening socket. i.e. If the listening application is on the same PC, set .Address of the connecting application to "127.0.0.1" or "localhost"

_________________
Yes it's me in the avatar


Top
 Profile  
Reply with quote  
 Post subject: Re: Creting a server...
PostPosted: Sat May 19, 2012 1:37 am 
Offline
User avatar

Joined: Sun Aug 12, 2007 10:10 am
Posts: 1086
Location: Boiling Springs, SC
Build the source and run 2 copies for an example...one will be a client..the other the server... Set both to your local ip (127.0.0.1) and set both ports to the same... Click listen on one and connect on the other..should say connected and you can pass data between the two :-) sorry should have given a little instruction..

_________________
Matthew A. Combatti
Real Studio 2012 r1.2

Visit Xojo Developer's Spot!
Systems I Use:
Windows XP/Windows Vista/Windows Server 2008 r2/Windows 7/Windows 8
Mac OSX 10.5/Mac OSX 10.6/Mac OSX Server/Ubuntu/Debian/Suse/Red Hat/
Windows Server 2011/CentOS 5.4 /ReactOS/SimOS

~All Xojo Compatible~


Top
 Profile  
Reply with quote  
 Post subject: Re: Creting a server...
PostPosted: Fri Jun 15, 2012 4:45 am 
Offline

Joined: Sat May 19, 2007 6:01 am
Posts: 300
simulanics wrote:
Here is a simple chat server/client in-one. Hope it helps. You will notice that very few lines of code are actually needed to have a working Client/Server :-) Let me know if you need any explanation or have any questions.

Source:
http://www.realstudiodevspot.com/demos/chat.rbp



Dear Friends!!
Excuse me for the slow conversation!! There has been so many things in my life and there were no time to spend making research in this issue.

However, last week I found this thread -- again. And to my great surprise, my lack of efforts in search for the problem solved itself this time!!

http://www.syscare.se/files/chat.zip
I've modified the code slightly. The IP will be whatever IP you happen to have and I think I changed the port to 5500...
Whatever. It works and I'm so happy that I found this thread because I don't want to cheat on the creads of someone else.

When compiling and running two copies it's working. Now.... The BIG CHALLENGE is to make it work in a greater perspective!! But also, now summer is coming up and I must be doing something useful when I'm not sleeping...!!

Thank you!


Top
 Profile  
Reply with quote  
 Post subject: Re: Creting a server...
PostPosted: Fri Jun 15, 2012 12:49 pm 
Offline
User avatar

Joined: Sun Aug 12, 2007 10:10 am
Posts: 1086
Location: Boiling Springs, SC
Glad to help :-)

Here's my latest server-based project ;-)
viewtopic.php?f=1&t=44165

_________________
Matthew A. Combatti
Real Studio 2012 r1.2

Visit Xojo Developer's Spot!
Systems I Use:
Windows XP/Windows Vista/Windows Server 2008 r2/Windows 7/Windows 8
Mac OSX 10.5/Mac OSX 10.6/Mac OSX Server/Ubuntu/Debian/Suse/Red Hat/
Windows Server 2011/CentOS 5.4 /ReactOS/SimOS

~All Xojo Compatible~


Top
 Profile  
Reply with quote  
 Post subject: Re: Creting a server...
PostPosted: Sat Jun 23, 2012 4:19 pm 
Offline

Joined: Sat May 19, 2007 6:01 am
Posts: 300
simulanics wrote:
Glad to help :-)

Here's my latest server-based project ;-)
viewtopic.php?f=1&t=44165



All right. That's a lot of information to INSERT INTO [my brain]...
I think I've read about Siri somewhere...

***
I stick to this thread for now!!

Two things, after fiddling with your code:
1. After executing two copies, starting to "Listen" on one and to "Connect" on the other, there is always an extra space (EndOfFile) in the text field hosting the conversation, i.e. txtChat.text. Where does that space come from and would it be possible to remove...??

2. After starting three copies, the second can connect to the first but the third will show #103 Error... Will this occur also IRL or only on my computer at home...

***
At least, I'm thrilled that it's actually working!!
I think I need to play more with the TCPSocket...!!


Top
 Profile  
Reply with quote  
 Post subject: Re: Creting a server...
PostPosted: Sat Jun 23, 2012 7:48 pm 
Offline
User avatar

Joined: Sun Aug 12, 2007 10:10 am
Posts: 1086
Location: Boiling Springs, SC
I will elaborate the code a bit more into a semi "chat server" to show how many clients can connect to the same server and how information can be passed to clients client-to-client, client-to-server, and server-to-client..learning how to manage, identify, create, and destroy active connects (as an array in our case) is a key concept...if I knew a little bit about what kind of server you were trying to create I could at least construct a barebones example you may be able to work off from and see how it applies to what you have in mind :-) will post something little later on tonight..

_________________
Matthew A. Combatti
Real Studio 2012 r1.2

Visit Xojo Developer's Spot!
Systems I Use:
Windows XP/Windows Vista/Windows Server 2008 r2/Windows 7/Windows 8
Mac OSX 10.5/Mac OSX 10.6/Mac OSX Server/Ubuntu/Debian/Suse/Red Hat/
Windows Server 2011/CentOS 5.4 /ReactOS/SimOS

~All Xojo Compatible~


Top
 Profile  
Reply with quote  
 Post subject: Re: Creting a server...
PostPosted: Sun Jun 24, 2012 7:22 am 
Offline

Joined: Sat May 19, 2007 6:01 am
Posts: 300
Oh....!! That's really too much!!
But if you can post a relevant code before Christmas I wouldn't mind...!!

***
Let me explain the software. I have (sort of) a working copy...

The software itself is really aiming at something else. The chat is only optional. It's support.

But it's a vital part of the software since different kind of people will chat with each other. In the support will be the web developers, in the chat, willing to speak with the support, will be the clients. The possible and future clients of the web developers.

The web developers will need to subscribe to be able to open (to start) a "server", a host. The "clients" can then connect to any server that fill their needs.

It's a business-to-business (B2B) software so there are clients and companies in both ends, but in different perspective.... For this reason, it's little difficult to explain in a a short sentence.

I'll write more, if I need!!

***
Are you familiar with Hotline? I'll write and upload an image...

Image

This software is called Hotline Connect. It was made back in 1997 and for Mac only, in the beginning.
It's a three component software. The Server, the Client and the Tracker, to keep track of all Servers. (By this time, many people had dial-up connections on dynamic IP's and the purpose were to share warez.)

I might include file transfer later, just for the convenience, but the file sharing is not a goal in itself, as with Hotline Server/Client as it was called at the time. However, I like this kind of service and I'd like to develop the software with this idea!

My software will be like the distributed cloud computing...!! All clients and servers shall be able to work using dynamic IP's... That's a goal for me!


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 14 posts ] 

All times are UTC - 5 hours


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

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group