Simple local network messaging.



Hi, I'm fairly new to Ruby and programming and I'm working on building a
very simple application to send text messages over a local network. I'm
fairly confident I can work out the messaging side of things, Ruby's
socket classes seem fairly straight forward. :)

My early prototype had one program to send messages and one to recieve
them but I was wondering if someone could give me a suggestion on how to
do both. Where I'm suck is getting the program to constantly let the
user type things into it while updating the messages as they are
recieved. I'm doing this purely as a command line application as I don't
want to make the code overly complicated with a GUI programing.

My early prototype worked fine sending messages to 'localhost' but when
I tried to send them to a local IP or hostname it seemed to send them
alright but the remote machine did not recieve them. I was using UDP to
do this however I am thinking about converting it to a TCP socket
instead.

I'm hoping to get a few suggestions in regards to the logic order of the
program. I've been looking for sample code of programs using the TCP
socket class but I've been pretty unsuccessful so far I'm pretty sure
that's because I'm googling badly but if anyone has some examples I
could look at that would be helpful.

Regards,
Adam
--
Posted via http://www.ruby-forum.com/.

.



Relevant Pages

  • Re: receiving data over socket
    ... I want to print the data the server received. ... anyone can recommend a good VB2005 book that deals with socket programming I ... if your server needs to support multiple connections ... You aren't guarenteed to recieve all your data ...
    (microsoft.public.dotnet.languages.vb)
  • TCP Quirk?
    ... I noticed that when I use send method on a "Socket" object twice, ... corresponding "socket" on the other application fails to recieve it. ... Client:= recieves a byte array from server using recieve ... connection: A connection attempt failed because the connected party did ...
    (microsoft.public.win32.programmer.networks)
  • Re: error while retrieving values from socket
    ... We are currently using a program where we recieve the details from the ... you have a valid socket error, which somehow results in you attempting to add a null string reference to your list box. ... Fix your socket error handling so that it catches the reset connection exception and doesn't try to add a null reference to the ListBox, and I would guess the NullReferenceException will go away. ...
    (microsoft.public.dotnet.framework)
  • Re: Gracefully disconnecting a TCP server
    ... from the server to the client before the socket is closed. ... >> the reasons for this has to be the ThreadPool which is used by the async ... >> be a free threat to handle the pending recieve operation, ...
    (microsoft.public.dotnet.languages.csharp)
  • SBS 2003 cant ftp from outside lan
    ... Setup SBS 2003 for ftp...works fine on local network, ... Recieve 426 connection closed error and ...
    (microsoft.public.windows.server.sbs)