Example of embedded TCP packet socket server using Grizzly

View: New views
2 Messages — Rating Filter:   Alert me  

Example of embedded TCP packet socket server using Grizzly

by javaguy44 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I'm new to Grizzly & NIO and was wondering if there are any experts out there who could give me a hand.

I've been trying to piece together an example with various bits of forum posts, examples and tests that people have submitted but I haven't been able to achieve a simple TCP server + Grizzly framework that can receive requests and return responses

What I'm trying to do is see how viable it is to use the Grizzly Framework for an embedded TCP server.

Using this example http://gallemore.blogspot.com/2007/07/using-grizzly-to-read-tcp-packets.html I'm able to read the packets.  However I'm unable to write a response :(

Could someone assist in showing me an example for how to return a response to the client?

I've also tried to use TCPSelectorHandler with a CallbackHandler but it's still not clear how to receive a tcp packet request and respond appropriately.

I'd be more than happy to submit these examples in a "Getting Started" type scenario; I can imagine that Grizzly would be much better for using an embedded TCP socket server as opposed to re-inventing the wheel.

Thanks and look forward to your reply!

Re: Example of embedded TCP packet socket server using Grizzly

by Oleksiy Stashok :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

sorry for late reply.
I can propose you to take a look at Grizzly 2.0. It's still under  
development, but IMO it's easier to use it, especially for client side.

We have samples module available [1]. You can start from simple Echo  
server, tunnel etc.

If you have any questions - please ask.

WBR,
Alexey.

[1] https://grizzly.dev.java.net/source/browse/grizzly/branches/2dot0/code/samples/framework-samples/src/main/java/com/sun/grizzly/samples/


On Nov 2, 2009, at 17:10 , javaguy44 wrote:

>
> Hi,
>
> I'm new to Grizzly & NIO and was wondering if there are any experts  
> out
> there who could give me a hand.
>
> I've been trying to piece together an example with various bits of  
> forum
> posts, examples and tests that people have submitted but I haven't  
> been able
> to achieve a simple TCP server + Grizzly framework that can receive  
> requests
> and return responses
>
> What I'm trying to do is see how viable it is to use the Grizzly  
> Framework
> for an embedded TCP server.
>
> Using this example
> http://gallemore.blogspot.com/2007/07/using-grizzly-to-read-tcp-packets.html
> I'm able to read the packets.  However I'm unable to write a  
> response :(
>
> Could someone assist in showing me an example for how to return a  
> response
> to the client?
>
> I've also tried to use TCPSelectorHandler with a CallbackHandler but  
> it's
> still not clear how to receive a tcp packet request and respond
> appropriately.
>
> I'd be more than happy to submit these examples in a "Getting  
> Started" type
> scenario; I can imagine that Grizzly would be much better for using an
> embedded TCP socket server as opposed to re-inventing the wheel.
>
> Thanks and look forward to your reply!
> --
> View this message in context: http://old.nabble.com/Example-of-embedded-TCP-packet-socket-server-using-Grizzly-tp26157720p26157720.html
> Sent from the Grizzly - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@...
> For additional commands, e-mail: users-help@...
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...