ratcateme Posted November 16, 2008 Share Posted November 16, 2008 i am currently just making this app that you telnet into and it prints lines to the screen i need it to print lots of lines very quickly at the moment i have it write a line one character at a time then i write a "\r\n" and usleep for 125000 or .125 seconds then sometimes it will send the line and other times it sends 2 lines at the same time so the client gets a gap with no input and sometimes it waits and sends 3 lines at the same time what i want to do is somehow flush the socket or write enough bits so it will send the data but the filler bits must be ignored at the client. is this even remotely possible. i have been looking around and i can't find anything. if it matters the size of one complete line it 52 bytes. but normally comes as a 104 or 156 byte packets. Scott. Quote Link to comment https://forums.phpfreaks.com/topic/132913-solved-flush-socket-or-something-similar/ Share on other sites More sharing options...
BK87 Posted November 16, 2008 Share Posted November 16, 2008 try linuxforums =) Quote Link to comment https://forums.phpfreaks.com/topic/132913-solved-flush-socket-or-something-similar/#findComment-691217 Share on other sites More sharing options...
ratcateme Posted November 17, 2008 Author Share Posted November 17, 2008 well i did a lot of research and found out about MTU (Maximum transmission unit) for Ethernet it is 1500 bytes including TCP and IP headers so i did more research and found out a TCP header is 20 bytes and same for a IP header so i added a pad to 1460 bytes of \000 or null Scott. Quote Link to comment https://forums.phpfreaks.com/topic/132913-solved-flush-socket-or-something-similar/#findComment-691948 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.