Sponsored Content
Full Discussion: Socket Keep-Alive
Top Forums Programming Socket Keep-Alive Post 302971950 by Corona688 on Wednesday 27th of April 2016 12:16:02 PM
Old 04-27-2016
Something fishy is going on with the way the connection lags before delivering the content of the first page...
 

9 More Discussions You Might Find Interesting

1. Programming

HTTP Keep-Alive socket problem

Hello everyone, I am a newbie in UNIX/Linux socket programming. This is a class project that I had trouble with. ================================================== I was trying to make “Keep-Alive” HTTP connections to the server in a tiny web crawler project. Here is the problem: when I tried... (0 Replies)
Discussion started by: imdupeng
0 Replies

2. UNIX for Dummies Questions & Answers

Socket still alive!!

Hi, I'm investigate about a problem regarding a connection between two server (S1 and S2). A client software on S1 made a pool of connections on S2; for some reason some connections end but sockets still alive on S2 and not on S1. I always knew about sockets as a pair of processes; is it... (1 Reply)
Discussion started by: grado
1 Replies

3. Shell Programming and Scripting

Can we keep our script alive while logging out.

Hi I want to keep my script running even when i am logged off from the box. can we run the script in background which can automatically run every hour? Please advise. Thank you (1 Reply)
Discussion started by: Prateek007
1 Replies

4. UNIX for Advanced & Expert Users

connect problem for sctp socket (ipv6 socket) - Runtime fail Invalid Arguments

Hi, I was porting ipv4 application to ipv6; i was done with TCP transports. Now i am facing problem with SCTp transport at runtime. To test SCTP transport I am using following server and client socket programs. Server program runs fine, but client program fails giving Invalid Arguments for... (0 Replies)
Discussion started by: chandrutiptur
0 Replies

5. Programming

which socket should socket option on be set

Hi all, On the server side, one socket is used for listening, the others are used for communicating with the client. My question is: if i want to set option for socket, which socket should be set on? If either can be set, what's the different? Again, what's the different if set option... (1 Reply)
Discussion started by: blademan100
1 Replies

6. Programming

socket function to read a webpage (socket.h)

Why does this socket function only read the first 1440 chars of the stream. Why not the whole stream ? I checked it with gdm and valgrind and everything seems correct... #include <stdio.h> #include <stdlib.h> #include <sys/types.h> #include <sys/stat.h> #include <string.h> #include... (3 Replies)
Discussion started by: cyler
3 Replies

7. Programming

Error with socket operation on non-socket

Dear Experts, i am compiling my code in suse 4.1 which is compiling fine, but at runtime it is showing me for socket programming error no 88 as i searched in errno.h it is telling me socket operation on non socket, what is the meaning of this , how to deal with this error , please... (1 Reply)
Discussion started by: vin_pll
1 Replies

8. IP Networking

Clarification - Setting socket options at the same time when socket is listening

I need clarification on whether it is okay to set socket options on a listening socket simultaneously when it is being used in an accept() call? Following is the scenario:- -- Task 1 - is executing in a loop - polling a listen socket, lets call it 'fd', (whose file descriptor is global)... (2 Replies)
Discussion started by: jake24
2 Replies

9. What is on Your Mind?

Is this forum alive?

Odd thing. I posted in the Solaris forum, new user, just asking for a bit of advice. Nothing too complicated. As of this post there have been 140 views and zero replies. So that got me thinking, is this normal? I had a look around, and I see the same thing on many other threads, and in other... (2 Replies)
Discussion started by: _JonB_
2 Replies
Ns_ConnFlush(3aolserver)				   AOLserver Library Procedures 				  Ns_ConnFlush(3aolserver)

__________________________________________________________________________________________________________________________________________________

NAME
Ns_ConnFlush, Ns_ConnFlushDirect - Flush content to an open connection SYNOPSIS
#include "ns.h" int Ns_ConnFlush(conn, buf, len, stream) int Ns_ConnFlushDirect(conn, buf, len, stream) ARGUMENTS
char *buf (in) Pointer to buffer to send. Ns_Conn conn (in) Pointer to current connection. int len (in) Length of bytes pointed to by buf. int stream (in) Boolean value to indicate a streamed response. _________________________________________________________________ DESCRIPTION
These routines support sending content to the client through the connection's communcation driver. They support generating both complete single responses or streaming content through multiple calls. They both take a pointer to the current connection specified by the conn argument and a pointer to content to send specified by buf of length len. If len is negative, buf is assumed to be a null terminated string and len is calculated by strlen. The stream argument, if zero, indicates a single response should be generated. In this case, an appropriate content-length header is gen- erated, the content is sent, and the connection is closed with Ns_ConnClose. If stream is not zero, the call is assumed to be one of potential multiple calls which will send content incrementally to the client. Content streamed in this case is sent either in chunked encoding mode for HTTP/1.1 clients or directly, without a content-length as was common in pre-HTTP/1.1 applications. Applications which stream content should be sure to make a final call Ns_ConnFlush or Ns_ConnFlushDirect with stream set to zero to correctly flush and close the connection. The Ns_ConnFlush and Ns_ConnFlushDirect differ in their treatment of the given content before sending. Ns_ConnFlushDirect does not alter the content in anyway, treating is as an arbitrary array of bytes. Ns_ConnFlush assumes the content is UTF-8 text, e.g., the result of an ADP page execution. In this case, if the connection has an associated output encoding set with the Ns_ConnSetEncoding routine, it will be used to encode the content in the requested character set (e.g., from UTF-8 to iso8859-1). In addition, if the server has gzip compression enabled, the nszlib module is loaded, the connection has been marked for gzip compression with the Ns_ConnSetGzipFlag, and the size of the output data is greater than the server configured minimun gzip compression size, the content will be compressed and an appropriate header will be generated for the client. Gzip compression is not supported when content is streamed to the client. The first call to Ns_ConnFlush or Ns_ConnFlushDirect for a connection, in stream or single response mode, will result in appropriate head- ers being constructed and sent first before any user data. These headers include the basic headers constructed via Ns_ConnSetRequiredHead- ers plus any additional application specific headers queued for output via Ns_ConnSetHeaders or Ns_ConnCondSetHeaders. The Ns_ConnFlush routine may add additional headers as needed to specify chunked and/or gzip encoding. EXAMPLE
The following example generates a simple text response: Ns_ConnSetStatus(conn, 200); Ns_ConnSetType(conn, "text/plain"); Ns_ConnFlush(conn, "Hello", 5, 0); The following example demonstrates streaming: Ns_ConnSetStatus(conn, 200); Ns_ConnSetType(conn, "text/plain"); for (i = 0; i < 10; ++i) { sprintf(buf, "stream: %d0, i); Ns_ConnFlush(conn, buf, -1, 1); } Ns_ConnFlush(conn, "done!", 5, 0); SEE ALSO
Ns_ConnSend(n), Ns_ConnClose(3), Ns_ConnSetRequiredHeaders(3), Ns_ConnQueueHeaders(3) KEYWORDS
connection i/o, gzip, stream, encoding, flush AOLserver 4.5 Ns_ConnFlush(3aolserver)
All times are GMT -4. The time now is 02:34 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy