Server and Client at the same time
"이희승 (Trustin Lee)"
trustin at gmail.com
Fri Jun 12 04:50:20 EDT 2009
Hi Gonzus,
I have been asked by many people about implementing such a proxy server,
so I decided to write an example proxy server. It's much easier to
write an implementation than to explain how to do that, especially when
it comes down to proxy server. :)
Check this out:
http://viewvc.jboss.org/cgi-bin/viewvc.cgi/netty/trunk/src/main/java/org/jboss/netty/example/proxy/
Shutting down is not very different from writing an ordinary server or
client application. Only one difference is that you need to shut down
both client side and server side ChannelFactory at last.
HTH,
Trustin
On 2009-06-11 오후 11:56, gonzus wrote:
>
> Hello everyone, this is my first post here. I am examining Netty (after a
> brief look at MINA) and would like to gather opinions on how to implement a
> proof of concept for my requirements.
>
> I intend to have two copies of the same program running on the same machine
> (this is not a requirement, it is just easier). The two programs will be run
> like this:
>
> $ program 8001 8002
> $ program 8002 8001
>
> This means the first copy will bind on port 8001 and try to connect to port
> 8002, and the second program will bind on port 8002 and try to connect to
> port 8001. After successful connection, the program will send a single
> string "Hello World"; after making sure it has sent one string and received
> one string, the program will shut down gracefully.
>
> What I am trying to learn is how to do the following in Netty:
>
> 1. Have an acceptor and connector at the same time running on the same
> program.
> 2. Handle failed connect attempts and a reconnection policy.
> 3. Proper way of shutting down a server.
>
> Are there any examples that could help me implement this? Any suggestions?
>
> Extra credit :-D if the program ends up being capable of running a single
> copy like this and doing "the obvious":
>
> $ program 8003 8003
>
> Thanks in advance and best regards.
--
— Trustin Lee, http://gleamynode.net/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 258 bytes
Desc: OpenPGP digital signature
Url : http://lists.jboss.org/pipermail/netty-users/attachments/20090612/a9c194e2/attachment.bin
More information about the netty-users
mailing list