As the title says... Chat on...

User avatar
By joe
#9395 When I do the following, it all appears to work (that is, my server sees the new connection on the socket, and then sees the data being sent, and then the close on the socket)
Code: Select allsu=net.createConnection(net.TCP)
su:connect(3000, "192.168.1.106")
su:send("abc\n")
su:close()

However, if I follow that with another connect command, e.g.,
Code: Select allsu:connect(3000, "192.168.1.106")
su:send("abc\n")
su:close()

Then this connection is not seen by the server. So, I'm a little confused as to this process. Do I really need to create another TCP connection? If so, what is the purpose of having 'createConnection' and 'connect' as two separate steps? I assumed the first just set up the data structure for a connection while connect and close do the work of actually establishing and closing the sockets.
User avatar
By alonewolfx2
#9399 you are closing socket quickly. you must to wait before closing.