hi Steven, thanks for the answer:), i'll currently implement a
client-side poke mechanism as a workaround, the client will send a
call every xx seconds, until told not to do so by the application.
Until authentication/authorization completes, app will check if the
result of auth request is ready at every poke :)
Here's another question, i was trying to understand red5's sources
today, starting from Standalone.java, but at the end of main, it
outputs "startup done in xx seconds" and exits from main() :) I want
to start understanding how red5 operates internally, but couldn't find
where to start :) any recommendations?
BTW, is red5 currently multithreaded or single threaded? I'm currently
broadcasting calls from one client to all other clients (i don't want
to use shared objects), for example, in a chat room, connection A
calls "say" method in the application, and the say method immediately
calls "connection A said bla bla" in connections B, C, and D. If
connections A, B, C, D are running on seperate threads (and as
IConnection is not thread safe currently), this would probably cause a
problem one day :)
thanks,
-kerem
On 5/7/06, Steven Gong <[EMAIL PROTECTED]> wrote:
> Hi Kerem,
>
>
> On 5/7/06, Kerem Hadimli <[EMAIL PROTECTED]> wrote:
> > well, i won't be dealing with local thread's connection, but accessing
> > that IConnection object from another thread (a thread created by
> > java.util.Timer).
> >
> > For example;
> >
> > client connects, invokes some call on server. When that call is
> > invoked, i create a new thread, to check if the username/password
> > information the client provided is correct, from a remote server (say
> > a DB server, or a http server, connected to a DB). I store the
> > IConnection object in that thread, and return the control to red5
> > (server side invoke is finished now). At a later time, when database
> > reply arrives, now, can i access the IConnection object's methods from
> > the other thread created before?
> >
> > I mean, this makes the IConnection object a shared resource between
> > threads (between red5's thread, and authentication-waiting thread i've
> > created before), is IConnection object thread-safe? (at least the
> > methods for invoking client calls, and disconnecting the client)
>
>
> In theory, you have access to IConnection and call methods on it on both
> threads. But as of now, the object is not implemented threading-safe. So you
> may need to do synchronization yourself.
>
> > Or, is there an alternative method for this, without blocking the
> > whole red5 server when a client connects, waiting for database reply?
>
>
> Maybe it's a good idea for Red5 core to implement this functionality
> internally thus to free you from creating asynchronous service-handling
> yourself. I will submit a ticket on Trac. Thanks, Kerem.
>
> > thanks,
> > -kerem
> >
> > On 5/6/06, Dominick Accattato < [EMAIL PROTECTED]> wrote:
> > > if your trying to access just that connections thread it would be a
> static
> > > method on the Red5 class
> > >
> > > /**
> > > * Get the connection associated with the current thread
> > > *
> > > * @return connection object
> > > */
> > > public static IConnection getConnectionLocal() {
> > > return connThreadLocal.get();
> > > }
> > >
> > > /**
> > > * Get the connection object
> > > *
> > > * @return connection object
> > > */
> > > public IConnection getConnection() {
> > > return conn;
> > > }
> > >
> > >
> > > On 5/6/06, Kerem Hadimli <[EMAIL PROTECTED] > wrote:
> > > >
> > > we've been trying to implement a http based authentication mechanism
> > > into a test application. This will prbably require using java's
> > > lang.util.Timer's. Is red5 thread-safe? I mean, i think we'll somehow
> > > create a thread (a Timer, etc) when we want to check authentication,
> > > and it'll call the handler in its new thread (when http request is
> > > replied). But then, can we call for example,
> > > (IServiceCapableConnection)conn.invoke(), or
> conn.close(),
> > > within this
> > > "other" thread?
> > >
> > > I've been thinking but couldn't find a workaround for this to call
> > > these red5 api functions through red5's own thread.
> > >
> > > thanks,
> > > -kerem
> > >
> > > _______________________________________________
> > > Red5 mailing list
> > > [email protected]
> > > http://osflash.org/mailman/listinfo/red5_osflash.org
> > >
> > >
> > > _______________________________________________
> > > Red5 mailing list
> > > [email protected]
> > > http://osflash.org/mailman/listinfo/red5_osflash.org
> > >
> > >
> > >
> >
> > _______________________________________________
> > Red5 mailing list
> > [email protected]
> > http://osflash.org/mailman/listinfo/red5_osflash.org
> >
>
>
>
> --
> Best Regards
> Steven Gong
> _______________________________________________
> Red5 mailing list
> [email protected]
> http://osflash.org/mailman/listinfo/red5_osflash.org
>
>
>
_______________________________________________
Red5 mailing list
[email protected]
http://osflash.org/mailman/listinfo/red5_osflash.org