Hello.

Maybe it's up to serverSocket. Could you expose whole code for verifying?

Thanks

Regard.
Jungtaek Lim (HeartSaVioR)


2015-04-07 12:27 GMT+09:00 Junfeng Chen <[email protected]>:

> I intend to establish Socket connection in spout. Here is my code :
>
> @Override
> public void nextTuple() {
>     Socket socket = null;
>     try {
>         socket = serverSocket.accept();
>     } catch (IOException e) {
>         e.printStackTrace();
>     }
>     TCPReceiver tcpReceiver = new TCPReceiver(socket,inQueue);
>     //disable thread to send the string immediately
>     tcpReceiver.receiveData();
>     if (!inQueue.isEmpty()){
>         String readyString = inQueue.poll();
>         _collector.emit(new Values(readyString));
>     }
> }
>
>
>
> The nextTuple() is blocked until new socket is established. It works under
> LocalCluster mode, but in production envirionment, tcp client cannot
> connect to this socket server. I use the command “nc -l 20000”(my listening
> port is 20000) while the program is running, it can receive the data from
> tcp client. Can any one help me? Thanks
>
>
>
> Regard,
>
> *Junfeng Chen**(陈俊峰)*
>
>
>



-- 
Name : 임 정택
Blog : http://www.heartsavior.net / http://dev.heartsavior.net
Twitter : http://twitter.com/heartsavior
LinkedIn : http://www.linkedin.com/in/heartsavior

Reply via email to