background preloader

Micro-Java

Facebook Twitter

Handshaking tutorial with Netty. Edit: The code for this project is now hosted at GitHub, along with other tutorials.

Handshaking tutorial with Netty

As we all did, I first started using plain NIO for highly scalable network based apps (mostly server-side). Then I jumped to Apache MINA, which I used for just about anything network related until a couple of months ago I discovered Netty. While MINA took the whole Java asynchronous I/O a step further, Netty pushed it two steps beyond that. 50,000+ connection TCP sender, Java NIO w/Netty - 始作俑者 - ITeye技术网站. Handling network timeouts in Java. By David Reilly Overview Handling timeouts is one of those tasks that people generally leave to the last moment.

Handling network timeouts in Java

In an ideal world, we'd never need them. In an intranet environment, where most programmers do their development, it's almost always unnecessary. Architecture of a Highly Scalable NIO-Based Server. If you are asked to write a highly scalable Java-based server, it won't take long to decide to use the Java NIO package.

Architecture of a Highly Scalable NIO-Based Server

To get your server running, you will probably spend a lot of time reading blogs and tutorials to understand the thread synchronization needs of the NIO Selector class and to deal with common pitfalls. This article describes the basic architecture of a connection-oriented NIO-based server. It takes a look at a preferred threading model and discusses the basic components of such a server. Threading Architecture. Windows TCP/IP Server Performance - Rambling Comments.

For the last week or so I've been working on measuring and improving the performance of The Server Framework.

Windows TCP/IP Server Performance - Rambling Comments

The latest release of the free version of my asynchronous, windows, IOCP based, socket server framework can now be obtained from here at ServerFramework.com. This week I've had several potential new clients asking about performance numbers for various aspects of the system and so I thought it best to do some measuring. To be able to measure I first had to build a tool to help me. My first potential client was interested in how many concurrent connections our framework could support. I'd never really tested this and whilst I knew that there were system wide limits that you hit when creating lots of socket connections I'd never looked into exactly what the limits were and when they caused problems. TCPLoadEchoServer / Code / [035c5e]

Play! deployment: netty good enough for 5k unique visitors? I use Netty4 to implement IMAP server.

play! deployment: netty good enough for 5k unique visitors?

When the server send big message to the client, channelWritabilityChanged() says that the channel becomes unwritable. That's OK as the size of the message is much higher than the writebufferHightWaterMark. But after the client received the message, channelWritabilityChanged() should get called again as the message in outputbuffer should be lower than writebufferLowWaterMark. Netty: asynchronous data transfer. User guide for 4.x · netty/netty Wiki. Preface The Problem.

User guide for 4.x · netty/netty Wiki

Netty, HttpAsyncClient and Blocking I/O Comparison: Netty, HttpAsyncClient and HttpClient Performance Comparison. I was searching for performance comparison of popular asynchronous HTTP clients, namely Netty, Apache's HttpAsyncClient and blocking I/O HttpClient with thread pool.

Netty, HttpAsyncClient and Blocking I/O Comparison: Netty, HttpAsyncClient and HttpClient Performance Comparison

The research is not just for pure comparison, but also to find the sweet spot of each type of the clients. This is an interesting post. Unfortunately, the comparison is based on file downloading, which is not exactly what most web services are built for. So I decided to run my own analysis based on typical client interactions with RESTful services, where the client sends a request and the server replies with a reasonable size of payload. Clients compared. Part 3: Internet Usage and Protocols. People Internet vs.

Part 3: Internet Usage and Protocols

Device Internet Not surprisingly, people and embedded devices use the Internet very differently. People make use of the Internet largely through the World Wide Web — a set of applications that run on the Internet. Of course, the Web is not the entirety of the human interface for the Internet. We also use e-mail, text messages, mobile apps, and bevy of social media tools. In the Internet of Things, by comparison, autonomous electronic devices exchange information with each other over the Internet. TCP/IP Protocol Stack. JAVA + SSL Tutorial. JAVA + SSL Tutorial (server and client examples) Certificate First we need to make certificate, this is done by using keytool that is part of J2SE SDK (program will ask for certificate owner information and password, enter 123456 as password, or you can enter your password, but notice that you have to change it in other commands listen in this tutorial): keytool -genkey -keystore mySrvKeystore -keyalg RSA After this command you will have certificate file in working directory of issuing keytool command.

JAVA + SSL Tutorial

Socket programming for scalable systems. In the late nineties I was working for an online video game company where I spent my days writing Unix Berkley Sockets and Windows WinSock code.

Socket programming for scalable systems

My task was to enable video game clients to communicate with a game server. When I had the opportunity to write some Java socket code, I was amazed by Java's streamlined and straightforward approach to network programming. This is no surprise because Java was originally designed to enable smart devices to communicate with one another, which translated very well to desktop and server applications. In 1996, JavaWorld published "Sockets programming in Java: A tutorial. " Tcp_tutorial.pdf. Eebandbs2_2column.pdf. Java 7 and Java 8 Programming Tutorial: Network Programming.

LIMATLecture-11.pdf. Sockets-notes.pdf. Sockets programming in Java: A tutorial. This classic JavaWorld tutorial presents an introduction to sockets programming over TCP/IP networks and demonstrates how to write client/server applications in Java. A bit of history The Unix input/output (I/O) system follows a paradigm usually referred to as Open-Read-Write-Close. Before a user process can perform I/O operations, it calls Open to specify and obtain permissions for the file or device to be used. Once an object has been opened, the user process makes one or more calls to Read or Write data.

Read reads data from the object and transfers it to the user process, while Write transfers data from the user process to the object. Networking (Socket Programming) Tutorial. The term network programming refers to writing programs that execute across multiple devices (computers), in which the devices are all connected to each other using a network. The java.net package of the J2SE APIs contains a collection of classes and interfaces that provide the low-level communication details, allowing you to write programs that focus on solving the problem at hand.

The java.net package provides support for the two common network protocols: TCP: TCP stands for Transmission Control Protocol, which allows for reliable communication between two applications. TCP is typically used over the Internet Protocol, which is referred to as TCP/IP.UDP: UDP stands for User Datagram Protocol, a connection-less protocol that allows for packets of data to be transmitted between applications.

This tutorial gives good understanding on the following two subjects: Finalreport.pdf. Serial Communication in Java with Raspberry Pi and RXTX. Serial communication is one of the ancient technologies in computing that is still relevant today. Its origins date back to the 1960′s when serial communication was used between teletypewriters and modems. Today, serial interfaces can be found inside myriads of embedded systems where they transfer data between different components. A serial interface is also a common way to connect a PC to an embedded system.

Application scenarios include firmware update, logging/debugging, data streaming and many more. In an earlier post I introduced the Raspberry Pi as a great platform for tinkering. History One of the first applications for serial data communication was the connection between teletypewriters and modems. Recent PC models usually don’t have a serial port (RS-232) any more. Hardware.