LNet problems lazarus / 38-Networking and Web Programming ---------------------------------------------------------------------- Jishaxe · 2011-04-11 14:21 Hello people. I post here today to ask for help with a problem I'm having. I'm coding some software that connects to a host using TCP with LNet, then sends a number of messages via SendMessage at a very fast speed. Code: [Select]Shutdown error [107]: Transport endpoint is not connected and Code: [Select]Get error [104]: Connection reset by peerI get these errors from the onError event, and I can't send any more. I'd like to know how they are caused and what they mean so I can catch them and explain them to the users. I don't get this error if I open a port on my own computer and connect to localhost, but I do when doing it to a website I get these errors. I assume it has something to do with the webserver rejecting it or something. Thanks in advance. - Jishaxe ---------------------------------------------------------------------- fabienwang · 2011-04-11 14:34 What port do you connect to? Does your machine listen to that port? (I.E. 80 => apache2 running?) ---------------------------------------------------------------------- Jishaxe · 2011-04-11 17:02 Quote from: FabienWang on April 11, 2011, 04:34:42 pmWhat port do you connect to? Does your machine listen to that port? (I.E. 80 => apache2 running?) Hello FabienWang, I am pretty sure that it actually establishes a connection before it sends these messages, because The onConnection event is firedThe SendMessage command only happens if a connected socket existsSo I don't think that's the problem, but anyway, I usually open port 20 on my computer via Code: [Select]sudo netcat -l 20or something like that, but if I am connected to a website then port 80 of course. Just to clarify, when I connect to my own computer it's only for testing. I don't run a webserver. ---------------------------------------------------------------------- Almindor · 2011-04-11 19:09 Quote from: Jishaxe on April 11, 2011, 04:21:56 pmHello people. I post here today to ask for help with a problem I'm having. I'm coding some software that connects to a host using TCP with LNet, then sends a number of messages via SendMessage at a very fast speed. Code: [Select]Shutdown error [107]: Transport endpoint is not connected and Code: [Select]Get error [104]: Connection reset by peerI get these errors from the onError event, and I can't send any more. I'd like to know how they are caused and what they mean so I can catch them and explain them to the users. I don't get this error if I open a port on my own computer and connect to localhost, but I do when doing it to a website I get these errors. I assume it has something to do with the webserver rejecting it or something. Thanks in advance. - Jishaxe These errors are usually reported when the other side simply crashed, or otherwise closed connection in a "bad" way. You said you use TCP but you also mention HTTP. Which protocol do you use? What is the server? Also how do you send "fast"? ---------------------------------------------------------------------- Jishaxe · 2011-04-11 19:43 Almindor2: Ah okay, now that I know what that means I can explain to the user what's wrong, so thanks. The server I would connect to would be www.example.com or Google or something. I connect to port 80 through TCP, not because I want to use HTTP, but because port 80 is usually the only open port on a website. If you check out my software's project page, Floody, in my signature then you'll understand what I mean and why it connects to web servers like that :L ---------------------------------------------------------------------- Almindor · 2011-04-11 20:50 It's quite possible that a "security" extension on the http server blocks you off after a few attempts (especially if you don't send valid HTTP requests and headers) to prevent DDOS. That'd explain why the disconnect is "forced" on you. ---------------------------------------------------------------------- Jishaxe · 2011-04-11 20:52 Ah okay brilliant, thank you.