Real Software Forums
http://forums.realsoftware.com/

Creting a server...
http://forums.realsoftware.com/viewtopic.php?f=2&t=43987
Page 1 of 1

Author:  Eclipse [ Sun May 13, 2012 2:00 pm ]
Post subject:  Creting a server...

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!?

Author:  simulanics [ Sun May 13, 2012 3:23 pm ]
Post subject:  Re: Creting a server...

What kind of server are you creating? Web? Chat? Database?

Author:  Eclipse [ Sun May 13, 2012 4:01 pm ]
Post subject:  Re: Creting a server...

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...

Author:  simulanics [ Sun May 13, 2012 6:32 pm ]
Post subject:  Re: Creting a server...

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 :-)

Author:  simulanics [ Sun May 13, 2012 6:58 pm ]
Post subject:  Re: Creting a server...

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

Author:  timhare [ Sun May 13, 2012 8:01 pm ]
Post subject:  Re: Creting a server...

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.

Author:  Eclipse [ Mon May 14, 2012 8:04 am ]
Post subject:  Re: Creting a server...

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!? : )

Author:  msssltd [ Fri May 18, 2012 10:24 am ]
Post subject:  Re: Creting a server...

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"

Author:  simulanics [ Sat May 19, 2012 1:37 am ]
Post subject:  Re: Creting a server...

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..

Author:  Eclipse [ Fri Jun 15, 2012 4:45 am ]
Post subject:  Re: Creting a server...

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!

Author:  simulanics [ Fri Jun 15, 2012 12:49 pm ]
Post subject:  Re: Creting a server...

Glad to help :-)

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

Author:  Eclipse [ Sat Jun 23, 2012 4:19 pm ]
Post subject:  Re: Creting a server...

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...!!

Author:  simulanics [ Sat Jun 23, 2012 7:48 pm ]
Post subject:  Re: Creting a server...

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..

Author:  Eclipse [ Sun Jun 24, 2012 7:22 am ]
Post subject:  Re: Creting a server...

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!

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/