From: Brian Candler Date: 2009-01-26T17:51:29+09:00 Subject: Re: How to receive data using socket programming Kamaljeet Saini wrote: > When i try to run the above code in the SciTE editor ( in the .rb file ) > by pressing F5, DOS console black window appear for ever and dont go > away. Good. It's a server, waiting for an incoming connection on TCP port 2100, as I already said. If you puts some 'puts' statements in, you'll find it gets as far as socket.accept which is where it is waiting. Try opening another window, typing "telnet 127.0.0.1 2100", and then typing 20 characters. If you don't understand the concepts of socket, bind, listen, accept then you need to get a good book on TCP/IP sockets programming. "Unix Network Programming vol.1" by Richard Stevens is excellent, although you may find it has way more information than you need right now. -- Posted via http://www.ruby-forum.com/.