[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Claire

7/22/2004 8:17:00 AM

I'm totally new to remoting and panicking.
I've 2 winforms applications. The client has to ask the server for a
database record asynchronously. Some time later the server returns the
response with data for the record.
I've found lots of simple examples on the net but they all seem to be for
pure single server/client classes of type MarshalByRefObject in console mode
and I can't seem to find out what to do( and where to do it ) if I want to
add something similar to my winform application.

Secondly,
I'm generally worried about this server port allocation where ports are
selected with no particular skill.
I'm assuming each application registers a port number for it's sole use.
So if all applications eventually go .net, then is it expected there'll be
exceptions flying as duplications happen?


2 Answers

Sunny

7/22/2004 2:43:00 PM

0

Hi,

In article <u$q$wQ8bEHA.996@TK2MSFTNGP12.phx.gbl>, blahhh@blahhhhh.com
says...
> I'm totally new to remoting and panicking.
> I've 2 winforms applications. The client has to ask the server for a
> database record asynchronously. Some time later the server returns the
> response with data for the record.
> I've found lots of simple examples on the net but they all seem to be for
> pure single server/client classes of type MarshalByRefObject in console mode
> and I can't seem to find out what to do( and where to do it ) if I want to
> add something similar to my winform application.

All examples are console apps, because it's easier to write and debug,
and shorter to publish. All of them contain at least 2 parts: the MBR
object and the channel and object registration. Nothing stops you to put
the channel and object registration in a windows form where it is
suitable for you - Main method, in Load event handler, in a button event
handler, etc. As in the server app you need to register the channels and
the object only once, most probably you want to do it in the Main
method. For the client, you may want to register the channel on demand.
Just make sure you do it only once, or you release and unregister the
channel before next registration. So you can put this code wherever it
is best for you.

>
> Secondly,
> I'm generally worried about this server port allocation where ports are
> selected with no particular skill.
> I'm assuming each application registers a port number for it's sole use.
> So if all applications eventually go .net, then is it expected there'll be
> exceptions flying as duplications happen?
>

Server port is static. I.e. you have to predefine it so it is known for
the clients. There is no way the client to guess where and how to
connect. Maybe you are confused reading lines like this:
channel = new TcpChannel(0), and because in the docs you read that it
chooses a random free port.

This code is usually used at the client. It creates basically 2
channels. One server and one client channel. The client channel does not
have port, because it is used to connect to the server on a wellknown
port. And the so called "server" channel at the client side, the system
chooses for you any free port, so you do not need to worry if any other
application on your machine uses any hardcoded port you may try to use
manually. So, this channel is only used for callbacks from the server,
I.e. when you want to provide a way the server to call back the client
(like rising an event, etc.). This port is used only for the current
connection and only by the server. And the client knows how to notify
the server for its callback port.

Sunny


yansimon52

12/28/2008 1:38:00 AM

0

On Dec 27, 8:11 pm, "kingkong" <hah...@yahoo.com> wrote:
> What do you expect when the budget for the entire Home team is only 1/10 of
> Singapore defence budget.

Read today Sunday Times.......18 motorist got nabbed by policeman,
manned by Inspector Shaari.

Yes we agree that motorist who drank liqour shouldn't drive their cars
cos, it may cause danger to others.
The point here I am stating is...........nowadays, we see alot of
malay police personnel patroling our street which I believe most sgian
don't feel quite comfortable with that..........no doubt, their police
chief were mostly chinese police personnel manupulating these so-
called simple ppl (paying lower salary and not complaining what) to do
those 'dirty jobs'..........not only we see these simple minded ppl
in the home team, we oso see these simple minded ppl in most govt stat
board's enforcement units........going round summoning ppl who commit
verli verli minor offences.
I believe the Home Team or govt agencies need to understand further
ahead, the future of Sg society..........surely not an unpleasant
society to live in.

Haloooooo.......we believe Sg has come this far to be 'cultured
society' and we don't need so many of these simple minded ppl to hit
on us so hard....making us verli frustrating at times........we need
sensible policeman who are able to judge (on the spot) what is rite
from wrong.

The other thing is, we don't need certain group of policeman who give
favouritism (on offence committed) to their own 'kaki nang'(once
offender mentioned its who and who are their relatives) ...like those
policeman in Malaysia......We need policeman that go by the book and
able to judge (on the spot) whether its an offence committed on
purpose.


>
> "truth" <tr...@universe.com> wrote in message
>
> news:Tai5l.4837$cu.3964@news-server.bigpond.net.au...
>
>
>
> > All the telltale signs are pointing strongly at a fast declining
> > standard of the Singapore Police. Slow response, no response,
> > screwup investigations, targeting those who complain against
> > the police officers, going after innocent Singaporeans exercising
> > their legitimate rights, failure to use common sense,  etc etc.
> > Of course Wong Kan Seng and his topdogs will continue to
> > claimed that they have the best police force in the world.
> > They have to do that in order to protect their own backside.
> > So in the end it is Singaporeans who are paying the price for
> > this drastic drop in the standard of policing in Singapore.
> > All this happens under Wong Kan Seng's watch. This asshole
> > is so incompetent and negligent. Rated as maximum potential
> > Deputy PS, he is now Deptuy PM. He is related to LHL
> > thru Ho Ching.- Hide quoted text -
>
> - Show quoted text -