Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Tue Nov 21, 2017 10:55 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 21 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: WEB EDITION ServerSocket App Open Event
PostPosted: Tue Jan 29, 2013 5:41 am 
Offline
User avatar

Joined: Sun Oct 28, 2012 4:54 am
Posts: 264
Location: Herts, UK
:roll: lol still can't figure out what I am not doing correctly.

If anyone has a spare couple of minutes would be grateful if you have a quick look at my WE code and advise.

http://justgoodit.eu5.org/wesocket.zip

Thanks for any help

_________________
Real Studio 2012 R2
SysInfo
BackTrack Linux/BackBox Linux/Debian Lenny/Windows 7/Windows 8/OpenWRT/OpenBSD
& Yes it's me in the Avatar


Top
 Profile  
Reply with quote  
 Post subject: Re: WEB EDITION ServerSocket App Open Event
PostPosted: Tue Jan 29, 2013 7:02 am 
Offline
Site Admin
User avatar

Joined: Tue May 06, 2008 1:07 pm
Posts: 1464
Location: NotEvenOnTheMap, CT
From the looks of it, your server socket is an instance on a page. This is wrong, since there could be any number of pages, including 0.

Create a property, not a local variable, on the app class. The type must either be a subclass of ServerSocket, or if you want to use the AddHandler feature, can be of type ServerSocket.

In your App object:
Function ServerAddSocket (Sender As ServerSocket)
Return New ClientSocket
End Function

Event Open
mServer = New ServerSocket
AddHandler mServer.AddSocket, AddressOf Self.ServerAddSocket
mServer.Port = 7777
mServer.MinimumSocketsAvailable = 10
mServer.MaximumSocketsConnected = 100
mServer.Listen
End Event
You should probably watch the error event too.

_________________
Thom McGrath - @tekcor
Web Framework Architect, Real Software, Inc.


Top
 Profile  
Reply with quote  
 Post subject: Re: WEB EDITION ServerSocket App Open Event
PostPosted: Tue Jan 29, 2013 8:08 am 
Offline
User avatar

Joined: Sun Oct 28, 2012 4:54 am
Posts: 264
Location: Herts, UK
Tim

Thanks for your help.

I have added the ServerAddSocket function to the App class and created a Property also in the App class 'mserver As ServerSocket'

When debug I get the error: :(

Type mismatch error. Expected Delegate(ServerSocket) as TCPSocket, but got Delegate (ServerSocket) as clientsocket
AddHandler mServer.AddSocket, AddressOf Self.ServerAddSocket

I only have to get this working to show working 'proof on concept' in order to get head of IT/Development to give us the OK
to ditch VB.NET and move forward with the WE for future projects.

:roll: Will be so happy when it's all over (wish I had never been tasked with it at times, but then I am just a humble employee)

_________________
Real Studio 2012 R2
SysInfo
BackTrack Linux/BackBox Linux/Debian Lenny/Windows 7/Windows 8/OpenWRT/OpenBSD
& Yes it's me in the Avatar


Top
 Profile  
Reply with quote  
 Post subject: Re: WEB EDITION ServerSocket App Open Event
PostPosted: Tue Jan 29, 2013 9:10 am 
Offline
Site Admin
User avatar

Joined: Tue May 06, 2008 1:07 pm
Posts: 1464
Location: NotEvenOnTheMap, CT
Change your AddSocket return type to TCPSocket.

_________________
Thom McGrath - @tekcor
Web Framework Architect, Real Software, Inc.


Top
 Profile  
Reply with quote  
 Post subject: Re: WEB EDITION ServerSocket App Open Event
PostPosted: Wed Jan 30, 2013 3:54 pm 
Offline
User avatar

Joined: Sun Oct 28, 2012 4:54 am
Posts: 264
Location: Herts, UK
:D Thanks Tom with you help things are starting to come together.

Just one more question if I may please.

I have a listbox within my Apps Default webpage and my EasyTCPSocket's connected event is

Session.WebPage1.ListBox1.AddRow(mystring)


My listbox doesn't get populate for some reason. Have looked in the LR but can't seem to find a reference for doing this
with the WE.

_________________
Real Studio 2012 R2
SysInfo
BackTrack Linux/BackBox Linux/Debian Lenny/Windows 7/Windows 8/OpenWRT/OpenBSD
& Yes it's me in the Avatar


Top
 Profile  
Reply with quote  
 Post subject: Re: WEB EDITION ServerSocket App Open Event
PostPosted: Wed Jan 30, 2013 4:00 pm 
Offline
Site Admin
User avatar

Joined: Tue May 06, 2008 1:07 pm
Posts: 1464
Location: NotEvenOnTheMap, CT
Most likely Session is not what you expect it to be. Honestly, I'm surprised you're not getting an exception.

The problem is the socket has no clue which session you mean.

_________________
Thom McGrath - @tekcor
Web Framework Architect, Real Software, Inc.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 21 posts ]  Go to page Previous  1, 2

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