Hi,

i have a question regarding who to implement it in a nice way.

Background:

The protocol i implements has upon a connection establishment a
small handshake. Mainly to choose which version and variant of
the protocol to use.
For the handshake i implemented a StateMachine, which upon a
session create event start the handshake. Thats works fine.

Now if i use the higher level implementation i have a method
connect which tells mina to use my iohandler etc and try to build
a connection. Next i send some protocol messages. Now i have the
problem that the handshake needs some time and between connect
and sending a message the state machine hasn't yet gone through
the handshake and thus don't forward the message top the socket,
as long it isn't in the matching state.
To avoid that i do the following in the connect method:

- connect
- wait for sessionCraeted event // now the StateMachine performs the hadnshake
- i sleep for about 2 seconds

And for that last step i have a feeling there must be a better way
to implement that?


best regards


Max Larsson

--
------------------------------------------------------------------------
Max Larsson
facilityboss GmbH
Rheinstrasse 75, 64295 Darmstadt / Germany
Handelsregister Darmstadt, HRB 86193
Geschäftsführer: Dipl.-Inform. Larsson

Fax: +49 6151 869 278
Mobil: +49 179 2184428
Email: [email protected]

Reply via email to