Search Results

Search found 26176 results on 1048 pages for 'stream socket client'.

Page 10/1048 | < Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >

  • [Linux] domain socket "sendto" encounter "errno 111, connection refused"

    - by z.cHris
    I am using domain socket to get values from another process, like A to get a value from B, It works well for months. But recently, A is failed during "sendto" message to B with "errno 111, connection refused" occasionally. I checked the B domain socket bind file, it is exists. I also do some tests in another machine, also works well. So, does anyone encounter this problem before? Can anyone have some clues what might be probably wrong in this scenario? Thanks very much.

    Read the article

  • Python, implementing proxy support for a socket based application (not urllib2)

    - by Terry Felkrow
    Hey guys, I am little stumped: I have a simple messenger client program (pure python, sockets), and I wanted to add proxy support (http/s, socks), however I am a little confused on how to go about it. I am assuming that the connection on the socket level will be done to the proxy server, at which point the headers should contain a CONNECT + destination IP (of the chat server) and authentication, (if proxy requires so), however the rest is a little beyond me. How is the subsequent connection handled, specifically the reading/writing, etc... Are there any guides on proxy support implementation for socket based (tcp) programming in Python? Thank you

    Read the article

  • Confusion in bind call in socket programming

    - by Tarun
    i was learning socket programming in unix using c/c++. I am confused with one function call bind(params..). Actually it takes the adreess structure "sockaddr_in" and we can create the structure in the following way sockaddr_in.*** = somthing.. sockaddr_in..s_addr htonl(INADDR_ANY) **Passing INADDR_ANY will alow to bind all local addresses** My question is , why do we need to use "INADDR_ANY" ? In my knowledge every machine can has only one unique IP Address. In this way there is only one address associated with the machien. Thye bind call should directly bind the socket to the single available address. Please explain what are the different scenarios and why is it so?

    Read the article

  • How to make gpg2 to flush the stream?

    - by Vi
    I want to get some slowly flowing data saved in encrypted form at the device which can be turned off abruptly. But gpg2 seems to not to flush it's output frequently and I get broken files when I try to read such truncated file. vi@vi-notebook:~$ cat asdkfgmafl asdkfgmafl ggggg ggggg 2342 2342 cat behaves normally. I see the output right after input. vi@vi-notebook:~$ gpg2 -er _Vi --batch ?pE??x...(more binary data here)....???-??.... asdfsadf 22223 sdfsdfasf Still no data... Still no output... ^C gpg: signal Interrupt caught ... exiting vi@vi-notebook:~$ gpg2 -er _Vi --batch /tmp/qqq skdmfasldf gkvmdfwwerwer zfzdfdsfl ^\ gpg: signal Quit caught ... exiting Quit vi@vi-notebook:~$ gpg2 < /tmp/qqq You need a passphrase to unlock the secret key for user: "Vitaly Shukela (_Vi) " 2048-bit ELG key, ID 78F446CA, created 2008-01-06 (main key ID 1735A052) gpg: [don't know]: 1st length byte missing vi@vi-notebook:~$ # Where is my "skdmfasldf" How to make gpg2 to handle such case? I want it to put enough output to reconstruct each incoming chunk of input. (Also fsyncing after each output can be benefitial as an additional option). Should I use other tool (I need pubkey encryption).

    Read the article

  • SSL connection hangs as client hello (curl, openssl client, apt-get, wget, everything)

    - by Niklas B
    Hi, I've run into a problem on my Debian VPS (a xen domU) regarding SSL. Namely almost all SSL connections hangs at client hello. For example: # curl -vI https://graph.facebook.com About to connect() to graph.facebook.com port 443 (#0) Trying 66.220.146.48... connected Connected to graph.facebook.com (66.220.146.48) port 443 (#0) successfully set certificate verify locations: CAfile: none CApath: /etc/ssl/certs SSLv3, TLS handshake, Client hello (1): It's the same when using the openssl client. However, some of the SSL traffic works (for example https://www.nordea.se). Server #uname -a Linux server.com 2.6.26-1-xen-amd64 #1 SMP Fri Mar 13 21:39:38 UTC 2009 x86_64 GNU/Linux It does however work on my Dom 0 (the main xen host). Apt-get I can't even run apt-get update with the debian security sources (hangs on reading headers) Open SSL At the begining I thought I had an old openssl client (0.9.8o-4) since I appeared to have a newer on the Dom 0 (0.9.8g-15+lenny8) but doing a manuanl update on the openssl deb didn't help. Open SSL Client This is the full output of when the openssl client hangs: http://pastebin.com/PAjwMap9 Closing thoughts I've Googled the crap out of this, and I'm not getting any further. I've seen problems with curl, apt-get etc. but they are all specific relating to the very application - not general for the system. Any thoughts?

    Read the article

  • How to make gpg2 flush the stream?

    - by Vi
    I want to get some slowly flowing data saved in encrypted form at the device which can be turned off abruptly. But gpg2 seems to not to flush it's output frequently and I get broken files when I try to read such truncated file. vi@vi-notebook:~$ cat asdkfgmafl asdkfgmafl ggggg ggggg 2342 2342 cat behaves normally. I see the output right after input. vi@vi-notebook:~$ gpg2 -er _Vi --batch ?pE??x...(more binary data here)....???-??.... asdfsadf 22223 sdfsdfasf Still no data... Still no output... ^C gpg: signal Interrupt caught ... exiting vi@vi-notebook:~$ gpg2 -er _Vi --batch /tmp/qqq skdmfasldf gkvmdfwwerwer zfzdfdsfl ^\ gpg: signal Quit caught ... exiting Quit vi@vi-notebook:~$ gpg2 " 2048-bit ELG key, ID 78F446CA, created 2008-01-06 (main key ID 1735A052) gpg: [don't know]: 1st length byte missing vi@vi-notebook:~$ # Where is my "skdmfasldf" How to make gpg2 to handle such case? I want it to put enough output to reconstruct each incoming chunk of input. (Also fsyncing after each output can be benefitial as an additional option). Should I use other tool (I need pubkey encryption).

    Read the article

  • When to use Nginx PHP Fast CGI with a TCP socket instead of a UNIX socket?

    - by user64204
    I've followed this guide to setup PHP in FastCGI mode with Nginx. This guide describes 2 ways of doing it: TCP socket and UNIX socket. I've ran some Apache Benchmark on my locale machine and here are the results: Below tests ran multiple times to get better average statistics: $ ab -c 200 -n 100000 http://.... APACHE: 1800 req/sec NGINX (TCP socket): 2500 req/sec NGINX (UNIX socket): 15000 req/sec As far as I understand, there is overhead with using a TCP socket rather than a UNIX socket, hence the better performance with the latter. However I was not expecting such a performance difference given that the TCP socket is on the localhost, and therefore would like to ask the following question: Q: Given the huge performance gain with using a UNIX socket, what are the configuration scenarios where it would make sense to use a TCP socket instead?

    Read the article

  • Create Zip file from stream and download it

    - by Navid Farhadi
    I have a DataTable that i want to convert it to xml and then zip it, using DotNetZip. finally user can download it via Asp.Net webpage. My code in below dt.TableName = "Declaration"; MemoryStream stream = new MemoryStream(); dt.WriteXml(stream); ZipFile zipFile = new ZipFile(); zipFile.AddEntry("Report.xml", "", stream); Response.ClearContent(); Response.ClearHeaders(); Response.AppendHeader("content-disposition", "attachment; filename=Report.zip"); zipFile.Save(Response.OutputStream); //Response.Write(zipstream); zipFile.Dispose(); the xml file in zip file is empty.

    Read the article

  • Comments in Activity Stream

    - by fesja
    Hi, I'm starting to develop an activity stream. I've read both How to implement the activity stream in a social network and What’s the best manner of implementing a social activity stream?. What I haven't found is the best way to add comments to the activities. As in facebook, each comment can be commented by another person. If each activity comment is saved as another activity, then I would not be able to get the activity of that comment without doing a query. So the solution I'm thinking is to save the comments inside the serialize data field of each activity. If the user wants to delete his comment, I would have to update that activity. Is this the correct solution? Is there a better approach? Thanks!

    Read the article

  • Android Stream Data Over Wifi?

    - by Neb
    Im trying to make an app for android that will stream the data of the accelerometer to be used as a game controller on my pc over a local wifi connection. Is it possible to make some kind of wifi stream of the accelerometer values in the android app and then make the pc somehow 'read' this stream? Or would it just be better for the pc to make endless calls to the phone getting the newest accelerometer values from a local android server? It would also have to send commands from the phone such as 'button1 pressed', 'button1 released'.

    Read the article

  • Writing to a java socket channel which should be closed does not generate an exception

    - by Dan Serfaty
    Hi all, We have a java server that keeps a socket channel open with an Android client in order to provide push capabilities to our client application. However, after putting the Android in airplane mode, which I expected would sever the connection, the server can still write to the SocketChannel object associated with that Android client and no error is thrown. Calling SocketChannel.isConnected() before writing to it returns true. What are we missing? Is the handling of sockets different with mobile devices? Thanks in advance for your help.

    Read the article

  • Can FLV AAC stream be played in Android

    - by HariKJ
    Hi, I'm trying to build a radio player and the client is providing a stream which is a FLV container with the audio being AAC When I read the headers it shows up as audio/aacp. I have tried all possible ways such as using the 1) Streaming through mediaplayer (Does not work) 2) Use the NPR mode of using a proxy stream (I get a broken pipe exception) 3) Play it in chunks ( Plays but I need the SDCard and the playback is not very great) 4) Use the GPL'd FAAD2 Library but I would have to pay the royalty fee Can some one help me out on figuring this issue out. The last option that I have is to have my client change the stream to mp3 container (which I know that it works) Regards, Hari

    Read the article

  • Outputting audio stream into microphone

    - by Brap
    Hey everyone. Is there a way of outputting audio from my program and redirecting that stream to the system's microphone input 'layer'? I understand this might require some low-level calls being 'Pinvoked', but are there any articles that might help me. For example, if I was to run the output audio stream of my application into Window's Sound Recorder program, it would think that the audio is coming from a microphone and thus record that. I don't want to record a stream, just output it to the device's micrphone input. Thanks for any ideas.

    Read the article

  • Socket.io Duplicate clients on a namespace

    - by Servernumber
    Hi I'm trying to use dynamic namespace to create them on demand. It's working except that I get duplicate or more client for some reason Server side : io.of("/" + group ).on("connection", function(socket_group) { socket_group.groupId = group; socket_group.on("infos", function(){ console.log("on the group !"); }) socket_group.on('list', function () { Urls.find({'group' : '...'}).sort({ '_id' : -1 }).limit(10).exec(function(err, data){ socket_group.emit('links', data); }); }) [...] }) Client Side : socket.emit('list', { ... }); On the client side only one command is sent but the server is always responding with 2 or more responses. Every time I close/open my app the response is incremented. Thanks if you find out.

    Read the article

  • ltsp-built-client error

    - by sat
    I am facing some issues while building a thin client using the ltsp-build-client, it says an error. Error is: I: Retrieving Release E: Failed getting release file file://root/ISO/ubuntu-12.04.1-desktop-i386.iso/dists/squeeze/Release error: LTSP client installation ended abnormally My Command is: ltsp-build-client --mirror file://root/ISO/ubuntu-12.04.1-desktop-i386.iso --security-mirror none --accept-unsigned-packages I am referring this URL http://wiki.debian.org/LTSP/Howto. How to solve this error?

    Read the article

  • Connect two client sockets

    - by Hernán Eche
    Good morning, let's say Java has two kind of sockets... server sockets "ServerSocket" client sockets or just "Socket" ////so Simple ! Imagine the situation of two processes: X Client <-- Y Server The server process Y : has a "ServerSocket", that is listening to a TCP port The client process X : send a connection request through a -client type- "Socket" X ////so Simple ! then the accept() method (in server Y) returns a new client type "Socket", when it occurs, great the two Sockets get "interconected", so the -client socket- in client process, is connected with the -client socket- in the server process then (reading/writing in socket X is like reading/writing in socket Y, and viceversa. ) TWO CLIENT SOCKETS GET INTERCONECTED!! ////so Simple ! BUT... (there is always a But..) What if I create the two CLIENT sockets in same process, and I want to get them "interconected" ? ////mmm Complex =(... even posible? Let's say how to have TWO CLIENT SOCKETS GET INTERCONECTED WITHOUT using an intermediate ServerSocket ? I 've solved it.. by creating two threads for continuously reading A and writing B, and other for reading B and writng A... but I think could be a better way..(or should!) (Those world-energy-consuming threads are not necessary with the client-server aproach) Any help or advice would be appreciated!! Thanks

    Read the article

  • C socket programming: connect() hangs

    - by Fantastic Fourier
    Hey all, I'm about to rip my hair out. I have this client that tries to connect to a server, everything seems to be fine, using gethostbyname(), socket(), bind(), but when trying toconnect()` it just hangs there and the server doesn't see anything from the client. I know that the server works because another client (also in C) can connect just fine. What causes the server to not see this incoming connection? I'm at the end of my wits here. The two different clients are pretty similar too so I'm even more lost. if (argc == 2) { host = argv[1]; // server address } else { printf("plz read the manual\n"); exit(1); } hserver = gethostbyname(host); if (hserver) { printf("host found: %p\n", hserver); printf("host found: %s\n", hserver->h_name ); } else { printf("host not found\n"); exit(1); } bzero((char * ) &server_address, sizeof(server_address)); // copy zeroes into string server_address.sin_family = AF_INET; server_address.sin_addr.s_addr = htonl(hserver->h_addr); server_address.sin_port = htons(SERVER_PORT); bzero((char * ) &client_address, sizeof(client_address)); // copy zeroes into string client_address.sin_family = AF_INET; client_address.sin_addr.s_addr = htonl(INADDR_ANY); client_address.sin_port = htons(SERVER_PORT); sockfd = socket(AF_INET, SOCK_STREAM, 0); if (sockfd < 0) exit(1); else { printf("socket is opened: %i \n", sockfd); info.sock_fd = sockfd; rv = fcntl(sockfd, F_SETFL, O_NONBLOCK); // socket set to NONBLOCK if(rv < 0) printf("nonblock failed: %i %s\n", errno, strerror(errno)); else printf("socket is set nonblock\n"); } timeout.tv_sec = 0; // seconds timeout.tv_usec = 500000; // micro seconds ( 0.5 seconds) setsockopt(sockfd, SOL_SOCKET, SO_RCVTIMEO, &timeout, sizeof(struct timeval)); rv = bind(sockfd, (struct sockaddr *) &client_address, sizeof(client_address)); if (rv < 0) { printf("MAIN: ERROR bind() %i: %s\n", errno, strerror(errno)); exit(1); } else printf("socket is bound\n"); rv = connect(sockfd, (struct sockaddr *) &server_address, sizeof(server_address)); printf("rv = %i\n", rv); if (rv < 0) { printf("MAIN: ERROR connect() %i: %s\n", errno, strerror(errno)); exit(1); } else printf("connected\n"); Any thoughts or insights are deeply greatly humongously appreciated. -Fourier

    Read the article

  • Correct usage of socket_select().

    - by Mark Tomlin
    What is the correct way to use socket_select within PHP to send and receive data? I have a connection to the server that allows for both TCP & UDP packet connections, I am utilizing both. Within these connections I'm both sending and receiving packets on the same port, but the TCP packet will be sent on one port (29999) and UDP will be sent on another port (30000). The transmission type will be that of AF_INET. The IP address will be loopback 127.0.0.1. I have many questions on how to create a socket connection within this scenario. For example, is it better to use socket_create_pair to make the connection, or use just socket_create followed by socket_connect, and then implement socket_select? There is a chance that no data will be sent from the server to the client, and it is up to the client to maintain the connection. This will be done by utilizing the time out function within the socket_select call. Should no data be sent within the time limit, the socket_select function will break and a keep alive packet can then be sent. The following script is of the client. // Create $TCP = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); $UDP = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP); // Misc $isAlive = TRUE; $UDPPort = 30000; define('ISP_ISI', 1); // Connect socket_connect($TCP, '127.0.0.1', 29999); socket_connect($UDP, '127.0.0.1', $UDPPort); // Construct Parameters $recv = array($TCP, $UDP); $null = NULL; // Make The Packet to Send. $packet = pack('CCCxSSxCSa16a16', 44, ISP_ISI, 1, $UDPPort, 0, '!', 0, 'AdminPass', 'SocketSelect'); // Send ISI (InSim Init) Packet socket_write($TCP, $packet); /* Main Program Loop */ while ($isAlive == TRUE) { // Socket Select $sock = socket_select($recv, $null, $null, 5); // Check Status if ($sock === FALSE) $isAlive = FALSE; # Error else if ($sock > 0) # How does one check to find what socket changed? else # Something else happed, don't know what as it's not in the documentation, Could this be our timeout getting tripped? }

    Read the article

  • How to create a link to Nintex Start Workflow Page in the document set home page

    - by ybbest
    In this blog post, I’d like to show you how to create a link to start Nintex Workflow Page in the document set home page. 1. Firstly, you need to upload the latest version of jQuery to the style library of your team site. 2. Then, upload a text file to the style library for writing your own html and JavaScript 3. In the document set home page, insert a new content editor web part and link the text file you just upload. 4. Update the text file with the following content, you can download this file here. <script type="text/javascript" src="/Style%20Library/jquery-1.9.0.min.js"></script> <script type="text/javascript" src="/_layouts/sp.js"></script> <script type="text/javascript"> $(document).ready(function() { listItemId=getParameterByName("ID"); setTheWorkflowLink("YBBESTDocumentLibrary"); }); function buildWorkflowLink(webRelativeUrl,listId,itemId) { var workflowLink =webRelativeUrl+"_layouts/NintexWorkflow/StartWorkflow.aspx?list="+listId+"&ID="+itemId+"&WorkflowName=Start Approval"; return workflowLink; } function getParameterByName(name) { name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]"); var regexS = "[\\?&]" + name + "=([^&#]*)"; var regex = new RegExp(regexS); var results = regex.exec(window.location.search); if(results == null){ return ""; } else{ return decodeURIComponent(results[1].replace(/\+/g, " ")); } } function setTheWorkflowLink(listName) { var SPContext = new SP.ClientContext.get_current(); web = SPContext.get_web(); list = web.get_lists().getByTitle(listName); SPContext.load(web,"ServerRelativeUrl"); SPContext.load(list, 'Title', 'Id'); SPContext.executeQueryAsync(setTheWorkflowLink_Success, setTheWorkflowLink_Fail); } function setTheWorkflowLink_Success(sender, args) { var listId = list.get_id(); var listTitle = list.get_title(); var webRelativeUrl = web.get_serverRelativeUrl(); var startWorkflowLink=buildWorkflowLink(webRelativeUrl,listId,listItemId) $("a#submitLink").attr('href',startWorkflowLink); } function setTheWorkflowLink_Fail(sender, args) { alert("There is a problem setting up the submit exam approval link"); } </script> <a href="" target="_blank" id="submitLink"><span style="font-size:14pt">Start the approval process.</span></a> 5. Save your changes and go to the document set Item, you will see the link is on the home page now. Notes: 1. You can create a link to start the workflow using the following build dynamic string configuration: {Common:WebUrl}/_layouts/NintexWorkflow/StartWorkflow.aspx?list={Common:ListID}&ID={ItemProperty:ID}&WorkflowName=workflowname. With this link you will still need to click the start button, this is standard SharePoint behaviour and cannot be altered. References: http://connect.nintex.com/forums/27143/ShowThread.aspx How to use html and JavaScript in Content Editor web part in SharePoint2010

    Read the article

  • How to connect with MySQL server if it won't connect via the socket?

    - by cwd
    I have an account on a shared server. I have jailshell access and also PhpMyAdmin. I want to run mysql commands via SSH but I'm getting an error: $ mysql -u mySqlUser -p mySqlPw Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' I can connect with PHP and phpMyAdmin, so would it be possible to call mysql from the shell and have it connect via an ip and port instead of the socket? The file /var/lib/mysql/mysql.sock does not exist - maybe that is intentional, and the only thing in /etc/my.cnf is [mysqld] skip-innodb More Info I don't have access to change system settings. I did a search in /var for mysql.sock but found nothing. However, phpMyAdmin might be connecting via a socket somehow: Really it would just be great if I could connect via IP. Also tried these two syntaxes: $ mysql -u mySqlUser -p mySqlPw -h localhost $ mysql -u mySqlUser -p mySqlPw -h localhost -P 3306 Both with the same result: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

    Read the article

  • I/O error(socket error): [Errno 111] Connection refused

    - by Schitti
    I have a program that uses urllib to periodically fetch a url, and I see intermittent errors like : I/O error(socket error): [Errno 111] Connection refused. It works 90% of the time, but the othe r10% it fails. If retry the fetch immediately after it fails, it succeeds. I'm unable to figure out why this is so. I tried to see if any ports are available, and they are. Any debugging ideas? For additional info, the stack trace is: File "/usr/lib/python2.6/urllib.py", line 235, in retrieve fp = self.open(url, data) File "/usr/lib/python2.6/urllib.py", line 203, in open return getattr(self, name)(url) File "/usr/lib/python2.6/urllib.py", line 342, in open_http h.endheaders() File "/usr/lib/python2.6/httplib.py", line 868, in endheaders self._send_output() File "/usr/lib/python2.6/httplib.py", line 740, in _send_output self.send(msg) File "/usr/lib/python2.6/httplib.py", line 699, in send self.connect() File "/usr/lib/python2.6/httplib.py", line 683, in connect self.timeout) File "/usr/lib/python2.6/socket.py", line 512, in create_connection raise error, msg Edit - A google search isn't very helpful, what I got out of it is that the server I'm fetching from sometimes refuses connections, how can I verify its not a bug in my code and this is indeed the case?

    Read the article

  • establishing a socket connection from iPhone to MAC/PC

    - by user319572
    Hello, I just started getting into XCode and Co. What I am trying is to send accelerometer data via WLAN to a PC or MAC over a Socket connection. I am trying at the moment with the iPhone simulator, on the other site a netbook with a JAVA program shall receive a test string for starters. Unfortunately my socket will not initialize. What am I doing wrong? NSString *recStr = @"192.168.0.5"; //String with receiver IP NSHost *hoster = [NSHost hostWithName:recStr]; //create a host NSOutputStream *sendData; //create an output stream [NSStream getStreamsToHost:hoster port:8000 inputStream:nil outputStream:&sendData]; [sendData retain]; [sendData setDelegate:self]; [sendData open]; A warning says NSStream may not respond to '+getStreamsToHost:inputSream:outputStream:' So I guess parameters are wrong. But why and how to do it right? The program starts but I don't think I can send anything as long as this warning shows up (have not tried though). Thank you in advance, Andreas

    Read the article

  • select always returns -1 while trying to read from socket and stdin

    - by Aleyna
    Hello I have the following code implemented on C++(Linux) to check on my listening socket and stdin using select. select however keeps returning -1 no matter what I try to do! What's wrong with that code :s I will appreciate any help. Thanks highsock = m_sock; //listening socket memset((char *) &connectlist, 0, sizeof(connectlist)); memset((char *) &socks, 0, sizeof(socks)); int readsocks; struct timeval timeout; timeout.tv_sec = 60; timeout.tv_usec = 0; while (1) { updateSelectList(); //cout << "highest sock: " << highsock << endl; tempreadset = readset; readsocks = select(highsock+1, &tempreadset, NULL, NULL, &timeout); //cout << "# ready: " << readsocks << endl; if (readsocks < 0) { if (errno == EINTR) continue; cout << "select error" << endl; } if (readsocks > 0) { readFromSocks(); } } void readFromSocks() { if (FD_ISSET(STDIN, &readset)) { ... } else if (FD_ISSET(m_sock, &readset)) { ... } } void updateSelectList() { FD_ZERO(&readset); FD_SET(STDIN, &readset); FD_SET(m_sock, &readset); for (int i=0; i<MAXCONNECTIONS; i++) { if (connectlist[i] != 0) { FD_SET(connectlist[i], &readset); if (connectlist[i] > highsock) highsock = connectlist[i]; } } highsock = max(max(m_sock, STDIN), highsock); }

    Read the article

< Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >