lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Jul 23, 2011, at 5:01 AM, Patrick Rapin wrote:

>> local assert (conn:send ("user\n"))
> 
> This isn't even valid Lua syntax! How can the script possibly run?
> Valid syntax would either be:
> 
> assert (conn:send ("user\n"))
> local result = assert (conn:send ("user\n"))
> 
> But the second form seems useless is this case.
> 

Another consideration is if the device you're opening the TCP connection to is actually implementing the TELNET protocol, or if it's just a dumb byte stream.  The TELNET protocol has some parameter negotiations that transpire during the session, and depending on the implementation, it might not behave as you expect if you don't respond to negotiations.   See http://lua-users.org/lists/lua-l/2007-10/msg00263.html for an example of this symptom.

Or, it it could just be a byte stream that happens to be on port 23 and this isn't a consideration as well, and your problems lie elsewhere.