accept

How do I send a custom header with urllib2 in a HTTP Request?

I want to send a custom "Accept" header in my request when using urllib2.urlopen(..). How do I do that? ...

WinForms Accept Button Annoyance

I have a base panel class that has (among other things) three buttons. I use subclasses of this base class in two different config dialogues. Both dialogues have an OK button set as the accept button. In one of the dialogues, if I click one of the buttons in the base class, focus immediately returns to the OK button, so pressing the ent...

How does Restlet handle the HTTP Accept header?

The Restlet framework is supposed to handle automatic content negotiation; however, it doesn't seem to do it properly. When a client sends and HTTP GET request with the Accept header with a value, Restlet doesn't automatically negotiates the content. Does anyone know how the Accept header is treated? ...

accept() with sockets shared between multiple processes (based on Apache preforking)

I'm working on some Python code modeled on Apache's MPM prefork server. I am more an applications programmer than a network programmer and it's been 10 years since I read Stevens, so I'm trying to get up to speed in understanding the code. I found a short description of how Apache's prefork code works, by Sander Temme. The parent pr...

jquery droppable accept

Hi All, Can anyone tell me how can i write a function in accept condition and then how does it finds out that what to accept and what not to accept. Fo r eg i want to accept div a and div b in accept condition.How can i write i through a function. ...

what ip address does accept return

see the following code: accept(sockfd, (struct sockaddr*)&cliaddr, &slen); cout << inet_ntop(AF_INET, cliaddr.sin_addr, ipv4addr, 100); my client connects from localhost. i get an absurd address in the output. this is not my ip address. everytime i run the code i get a different ip address. when i ping that ip address i don't get any ...

Set Response format inside a function according to Accept header and not outside with ResponseFormat = WebMessageFormat.Json in REST

Hi there, i am using the Plain old XML template from WCF REST Starter Kit Preview 2 to build a REST service and i would like to set the ResponseFormat inside the OperationContract, not outside(not with ResponseFormat = WebMessageFormat.Json) because i want to set it accordingly to the Accept Header in the Request. and ideally i would lik...

Rejecting a TCP connection before it's being accepted?

There are 3 different accept versions in winsock. Aside from the basic accept which is there for standard compliance, there's also AcceptEx which seems the most advanced version (due to it's overlapped io capabilities), and WSAAccept. The latter supports a condition callback, which as far as I understand, allows the rejection of connecti...

Accept SSL Certificate in vb6 using the Webbrowser control.

The Problem: I am creating a vb6 application that will connect to a particular web service located on a a HTTPS site. The problem is, the HTTPS site I'm accessing requires all request to accept it's certificate policy. (as its a self-signed ssl certificate) Basically I need the application to accept security certificate dialog boxes aut...

accept/epoll problem

I have this code that uses epoll and it has a problem. When I run it, it gives output: Server-socket() is OK... Server-bind() is OK... 3 4 accept: Invalid argument I'm running it on ubuntu linux, system updated, both as limited user and root what is wrong with the input to accept? What should I change? struct epoll_event ev, events[...

Java socket accept queue length

According to the Sun's documentation on ServerSocket: The maximum queue length for incoming connection indications (a request to connect) is set to 50. If a connection indication arrives when the queue is full, the connection is refused. How can I increase the the queue length? It's my server's bottle-neck. Thank you. ...

Socket listen doesn't unbind in C++ under linux

I have a socket that listens on some port. I send the SIGSTOP signal to the thread that waits on the port(using accept) and terminate it. then I close the fd of the socket that I waited on. But for the next run of my project it doe's not allow me to listen on that port again. My program is in C++ under linux. What should I do? Some part...

Why would Linux reuse a file descriptor allocated by pipe()

I'm seeing an issue using both sockets and pipes in Linux. Specifically, we call pipe(), which allocates the next two available file descriptors... let's say 10 and 11. Then we call accept() on a socket, expecting it to allocate 12. Instead, it allocates 11. We've tested a bit, and it seems the second FD returned from pipe() is alway...

socket.accept error 24: To many open files

I have a problem with open files under my Ubuntu 9.10 when running server in Python2.6 And main problem is that, that i don't know why it so.. I have set ulimit -n = 999999 net.core.somaxconn = 999999 fs.file-max = 999999 and lsof gives me about 12000 open files when server is running. And also i'm using epoll. But after some ti...

in socket programming, can accept() the same listening socket in multi-process(thread)?

i.e. open a listening socket in parent process call epoll_wait(listening_socket) in child1,child2,child3.... call accept in each child if there is connection request ...

WSACONNREFUSED when connecting to server

I'm currently working on a server. I know that the client side is working (I can connect to www.google.com on port 80, for example), but the server is not functioning correctly. The socket has socket()ed, bind()ed, and listen()ed successfully and is on an accept loop. The only problem is that accept() doesn't seem to work. netstat sh...

WinSock best accept() practices

Imagine you have a server which can handle only one client at a time. The server uses WSAAsyncSelect to be notified of new connections. In this case, what is the best way of handling FD_ACCEPT messages: A > Accept the connection attempt right away but queue the client until its turn? B > Do not accept the next connection attempt until ...

how can I restrict django ImageFieldFile to accept input only Image files from browser?

I've used django ImageFieldFile, from django.db.models.fields.files import ImageFieldFile now I want to restrict the user to use only Image files when uploading from browser ...

Java "Printer is not accepting jobs" old Brother printers

Hello, I have client which has a problem with printing from JAVA applications, using old Brother printers. The exception he gets is "Printer is not accepting jobs". Other applications (not java applications) manage to print using these printers. He switched to a new printer (also Brother), without changing the driver and then it worke...

Creating a local server visible through firewalls

I have a local server written in C++ listening to inbound TCP connects using plain socket ::accept() and UDP recvfrom(). I have two problems with this that I wish to solve: Can I programatically make Windows let me open the accept socket without it automatically being blocked by the Windows (software) firewall? Are there any ports I ca...