Skip to main content

Writing a TCP/UDP stack supporting the SIP protocol using the Grizzly Framework, part II

Posted by jfarcand on June 25, 2008 at 2:28 PM PDT

This blog has moved here

Related Topics >>

Comments

@nikhil_garg Please follow the discussion via the users@grizzly.dev.java.net. You can use Nabble -> http://www.nabble.com/(Getting-started-with-Grizzly)-Re%3A--Jean-Francois-Arcand%27s-Blog--New-Comment-Posted-to-%27Writing-a-TCP-UDP-stack-supporting-the-SIP-protocol-using-the-Grizzly-Framework%2C-part-II%27-td23445990.html

Hi, Can you plz tell me as to how should i approach in setting up this framework.I am not able to get as how to start (I have to make some *.sar file and deploy in sailfin?? or what) I need some assistance. Thanx in advance.

Hi, I am using one of the gaming server from sun which is Project Darkstar.I have a gaming client and a server. I need to communicate between them using SIP messages so I need to use grizzly framework. I wanted to use this because even in Project Darkstar the communication between client and server is through NIO. This is what i want to achieve.

thanks for your suggestion.I used sailfin to register the sip clients.As the post written by one of the users i wanted grzzley framework to be an interface between a client and server which can take TCP messages from client convert it to SIP messages and then send these messages to the sip server.This server should then decode the messages and send back to the client interface. In short client and server communication through grizzly framework. Any assistance with this.

Hi, I am new to Grizzly framework. I tried to run the SipServerDemo code in eclipse.I have included the grizzly-nio-framework 1.9.15.jar in the eclipse.But i saw the Pipeline and DefaultPipeline classes are missing in the jar.Can somebody assist me on this.

Hi Jean, I need to built a gateway/proxy for communication between a TCP stack and a sip server. The flow would be: SIP server<-> Proxy(using Grizzly framework)<-> TCP stack. The functionalities of the proxy would be: 1. Understand TCP messages and convert them to SIP messages. 2. Send the SIP messages to a sip server. 3. Understand SIP messages and convert them to TCP messages and send them to the TCP stack. In between the TCP stack and the sip server I need some kind of gateway to translate TCP messages to SIP and vice versa. I need to built that gateway/proxy kind. Please can anyone suggest whether this can be done using Grizzly framework.

Fixed. Many thanks Mark!!! -- Jeanfrancois

One more thing :) Line 53, ch.connect(new InetSocketAddress("localhost",8080),null); Gives an error: "The method connect(SocketAddress, CallbackHandler) is ambiguous for the type ConnectorHandler" so just need to cast the null to a CallbackHandler: connectorHandler.connect(new InetSocketAddress("localhost",8080), (CallbackHandler)null); Cheers, Mark

LOL :-) Fixed! Thanks!

line 27 there is a ")" trailing at the end.. you should test your code before posting :)

I think your sample doesn't compile look at the lines 19 TCPSelectorHandler tcpSelector = new TCPSelectorHandler(); 20 tcpSelectorHandler.setPort(8080); 21 controller.addSelectorHandler(tcpSelector); the variable is tcpSelector and the line later it's called : tcpSelectorHandler unless the variable tcpSelectorHandler is declare somewhere else. same thing for the UDP

ok.. c'est plus fort que moi.. Pipeline mySharedPipeline = new DefaultPipeline(); 28 pipeline.setMaxThreads(5); 29 should be : 28 mySharedPipeline .setMaxThreads(5); One question... why you don't include a zip file of your samples in your blog ?