겨울팥죽 여름빙수
Java, Number Regular-Expression
게임을 만들자/Java 2014. 9. 27. 00:06

1. Overview In Java, [tryParse] is not supported like c#. When String text is not number, Integer.parseInt() or Float.parseFloat() don't return false but throw exception. So developer have to make this function. One way is using Regular-Expression. 2. Code Below code show Regular-Expression of getting number from String. String text = text_field.getText(); Pattern p = Pattern.compile("-?([\\d]+)..

article thumbnail
Netty(java nio 통신 프레임워크) 대략적인 흐름
게임을 만들자/Java 2014. 4. 15. 13:48

Netty를 이용하면 간단하고 편리하게 client/server를 만들 수 있다.아래는 그림은 Channel, Pipleline, Context, Handler 의 관계를 나타내는 그림이다. Netty는 이벤트 Intercepting Filter pattern의 구조를 가진다. 무슨말이냐 하면, 사용자가 접속하거나, 읽어나, 쓰거나, 나가거나 하는 등의 이벤드를 발생시키고, Handler에서 이벤트를 받아 처리하면된다. 새로운 client가 서버에 접속하면, 채널과 이를 위한 파이프라인이 생성된다. 뭐 채널이 생성되는건 다른 소켓통신에서도 마찬가지니 설명안해도 알 것이다.client당 채널과 파이프라인이 있다고 생각하면된다. 그리고 채널을 통해 bind, read, write, close 등을 실행했을때..