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_ConnContent(3aolserver)				   AOLserver Library Procedures 				Ns_ConnContent(3aolserver)

__________________________________________________________________________________________________________________________________________________

NAME
Ns_ConnContent, Ns_ConnContentLength, Ns_ConnContentFd, Ns_ConnContentOnDisk - Routines to access request content SYNOPSIS
#include "ns.h" char * Ns_ConnContent(Ns_Conn *conn) int Ns_ConnContentLength(Ns_Conn *conn) int Ns_ConnContentFd(Ns_Conn *conn) int Ns_ConnContentOnDisk(Ns_Conn *conn) ARGUMENTS
Ns_Conn *conn (in) Pointer to given connection. _________________________________________________________________ DESCRIPTION
These procedures provide access to the request content sent with a request. char *Ns_ConnContent Returns a pointer to the content in memory. The result of Ns_ConnContent is not guarenteed to be null-terminated. Safe code should be careful to use the result of Ns_ConnContentLength to avoid overrun. int Ns_ConnContentFd Returns a file descriptor to an open temporary file which contains the content. int Ns_ConnContentLength sent beyond the content from com- Returns the length of the memory buffer and/or the size of the open temporary file. Any trailing mon browsers on a POST request is not included. int Ns_ConnContentOnDisk Returns 1 if the content is currently on disk, such that a call to Ns_ConnContentFd will not cause a new file to be created. When it returns 0, a call to Ns_ConnContent will not require a mmap() call. CONTENT PRE-READ While receiving the request before connection processing, the server will pre-read the entire content body and either copy the content to memory or spool it to an open file depending on virtual server config settings. Requests with content beyond the maxcontent virtual server setting are rejected, requests with content between maxinput and maxcontent are spooled to a temp file, and small requests (the majority of simple POST's) are copied to memory. There is no need for a request processing extension to consider possible delays in reading content from the client as all content is avail- able before connection processing begins. The rationale for this approach is that the driver thread can efficiently multiplex reading con- tent for serveral request, tolerating any network delays. Legacy direct content reading routines, for example, Ns_ConnRead, are now emu- lated on top of the Ns_ConnContent. RESOURCE MANAGEMENT
Ns_ConnContentFd returns an open file descriptor allocated by a call Ns_GetTemp and must not be closed as it is owned by the server core and will be closed at the end of the connection. In addition, there is no filename for the open file as the file is removed when opened for security reasons and to ensure garbage collection. In practice, the open file should be used to verify, parse, and copy content else- where as required. Access at the Tcl level is also available via the ns_conn contentchannel option. On a call to Ns_ConnContent, either the existing memory buffer will be returned or the temp file will be memory mapped on the first call. This will require temporary virtual memory to support the mapping until the end of the connection. Likewise, on the first call to Ns_Con- nContentFd, if a temp file does not already exists one will be allocated and the memory content will be spooled to the file. These seman- tics allow one to access the content in either mode, assuming resources are available, regardless of the original location of the content. DESIGN NOTES AND LARGE CONTENT CONSIDERATIONS
The design goal of the server is to support the ordinary case of reasonably small content requests (i.e., POST forms and small file uploads) in a convienent way without limiting a custom app to support very large requests. In particular, a call to Ns_ConnGetQuery for a multipart/file-upload POST will result in an implicit call to Ns_ConnContent to parse the fields. This could require significant temporary virtual memory plus dynamic memory to copy non-file fields into the resulting Ns_Set. See the ns_limits command to control maximum resource requirements. For custom apps, an extension could work with the underlying open file via Ns_ConnContentFd or ns_connn contentchannel to avoid large vir- tual memory requirements subject to disk space availability. To avoid inadvertant memory mapping of a large upload by other extensions calling Ns_ConnGetQuery, consider using a HTTP method other than GET or POST required by Ns_ConnGetQuery, e.g., PUT. SEE ALSO
Ns_Conn(3), Ns_ConnRead(3), ns_limits(n), ns_conn(n) KEYWORDS
connection, content AOLserver 4.0 Ns_ConnContent(3aolserver)
All times are GMT -4. The time now is 06:04 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy