Search Results

Search found 6654 results on 267 pages for 'socket io'.

Page 17/267 | < Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >

  • Using mod_wsgi with mpm_itk: socket permission issue

    - by djechelon
    I'm using mod_itk as MPM for increased security in shared environment. I also have a Firefox Sync Server within one of the VHosts I host. That vhost is restricted to a certain user via AssignUserId user group. The problem is that the socket /var/run/wsgi...whatever.sock is chmodded srwx------ and owned by Apache's wwwrun. While I configured the vhost with WSGIProcessGroup sync WSGIDaemonProcess sync user=djechelon group=djechelon processes=1 threads=5 I still get the error that Apache wants to access a socket that is not accessible and because of this gets an error. Is it possible to configure mod_wsgi in order to create different sockets with different owners for different applications or to chmod its socket in a different way (less secure)? Currently, I'm running Firefox Sync as the only WSGI application. Moving it to a vhost that doesn't AssignUserId could solve this problem but will force me to change URL (and buy an additional SSL certificate), so I wouldn't consider this

    Read the article

  • Does private browsing prevent socket events?

    - by Chris Cirefice
    I usually do my work in Google Chrome (v36.0.1985.143), private browsing enabled. I use Firefox to browse Stack Exchange, in normal mode so that all my logins are persisted. Sometimes I accidentally open an SE question in Chrome, so I copy-paste the URL to Firefox and get on reading. I left the SE tab in Chrome open, and up-voted a question in Firefox. Normally, you immediately see other users' voting activity via socket event emitting (possibly Socket.IO, I don't know SE's back-end). I noticed that in my Chrome tab, I didn't see the upvote that I had cast in Firefox. I had to refresh to be able to see the vote count change. So, as the title of the question states: does private browsing prevent socket events?

    Read the article

  • TCP Windows Size vs Socket Buffer Size on Windows

    - by Patrick L
    I am new to Windows networking. When people talk about TCP tuning on Windows platform, they always mention about TCP Window Size. I am wondering whether Windows uses the concept of "Socket Buffer Size"? On Windows XP, the TCP window size is fixed. We can set it using the TCPWindowSize registry value. How about Socket Buffer Size? How can we set Socket Buffer size on Windows? Can we set it to a value different from TCP window size?

    Read the article

  • What's so bad about pointers in C++?

    - by Martin Beckett
    To continue the discussion in Why are pointers not recommended when coding with C++ Suppose you have a class that encapsulates objects which need some initialisation to be valid - like a network socket. // Blah manages some data and transmits it over a socket class socket; // forward declaration, so nice weak linkage. class blah { ... stuff TcpSocket *socket; } ~blah { // TcpSocket dtor handles disconnect delete socket; // or better, wrap it in a smart pointer } The ctor ensures that socket is marked NULL, then later in the code when I have the information to initialise the object. // initialising blah if ( !socket ) { // I know socket hasn't been created/connected // create it in a known initialised state and handle any errors // RAII is a good thing ! socket = new TcpSocket(ip,port); } // and when i actually need to use it if (socket) { // if socket exists then it must be connected and valid } This seems better than having the socket on the stack, having it created in some 'pending' state at program start and then having to continually check some isOK() or isConnected() function before every use. Additionally if TcpSocket ctor throws an exception it's a lot easier to handle at the point a Tcp connection is made rather than at program start. Obviously the socket is just an example, but I'm having a hard time thinking of when an encapsulated object with any sort of internal state shouldn't be created and initialised with new.

    Read the article

  • Android 2.2 and "Bad address family" on Socket Connect

    - by Josh
    I have a fairly simple game that works perfectly on every version now up through 2.1, but with the new 2.2 (Froyo) release I am unable to create a socket. I am using the mina package for nio, and get this exception: W/System.err( 263): java.net.SocketException: Bad address family W/System.err( 263): at org.apache.harmony.luni.platform.OSNetworkSystem.connectStreamWithTimeoutSocketImpl(Native Method) W/System.err( 263): at org.apache.harmony.luni.platform.OSNetworkSystem.connect(OSNetworkSystem.java:115) W/System.err( 263): at org.apache.harmony.nio.internal.SocketChannelImpl.connect(SocketChannelImpl.java:272) W/System.err( 263): at org.apache.harmony.nio.internal.PipeImpl$SinkChannelImpl.finishConnect(PipeImpl.java:164) W/System.err( 263): at org.apache.harmony.nio.internal.PipeImpl.(PipeImpl.java:48) W/System.err( 263): at org.apache.harmony.nio.internal.SelectorProviderImpl.openPipe(SelectorProviderImpl.java:51) W/System.err( 263): at org.apache.harmony.nio.internal.SelectorImpl.(SelectorImpl.java:141) W/System.err( 263): at org.apache.harmony.nio.internal.SelectorProviderImpl.openSelector(SelectorProviderImpl.java:58) W/System.err( 263): at java.nio.channels.Selector.open(Selector.java:48) W/System.err( 263): at org.apache.mina.transport.socket.nio.SocketConnector.startupWorker(SocketConnector.java:248) W/System.err( 263): at org.apache.mina.transport.socket.nio.SocketConnector.connect(SocketConnector.java:210) W/System.err( 263): at org.apache.mina.transport.socket.nio.SocketConnector.connect(SocketConnector.java:137) W/System.err( 263): at org.apache.mina.common.support.BaseIoConnector.connect(BaseIoConnector.java:40) Later in the log, usually immediately following I get this: W/System.err( 263): java.lang.NullPointerException W/System.err( 263): at org.apache.harmony.nio.internal.SelectorImpl.wakeup(SelectorImpl.java:418) W/System.err( 263): at org.apache.mina.transport.socket.nio.SocketConnector.connect(SocketConnector.java:222) W/System.err( 263): at org.apache.mina.transport.socket.nio.SocketConnector.connect(SocketConnector.java:137) W/System.err( 263): at org.apache.mina.common.support.BaseIoConnector.connect(BaseIoConnector.java:40) I have done all the googling and looking around I can think of and found nothing. The closest I have come seems to be an old JDK bug with ipv6 support on XP and Vista machines (I'm running Vista). Recommendations included disabling ipv6 (that did not work) and disabling ipv4 and leaving ipv6 (will not work for me as my router and ISP don't support it and so could not test anyway). Any thoughts, suggestions, things I have not tried? Thanks, Josh

    Read the article

  • Socket stops communicating

    - by user1392992
    I'm running python 2.7 code on a Raspberry Pi that receives serial data from an Arduino, processes it, and sends it to a Windows box over a wifi link. The Pi is wired to a Linksys router running in client bridge mode and that router connects over wifi to another Linksys router to which the Windows box is wired. The code in the Pi runs fine for some (apparently) random interval, and then the Pi becomes unreachable from the Windows box. I'm running PUTTY on the the Windows machine to connect to the Pi and when the fail occurs I get a message saying there's been a network error and the Pi is not reachable. Pinging the Pi from the Windows machine works fine until the error, at which time it produces "Reply from 192.168.0.129: Destination host unreachable." The client bridge router to which the Pi is connected remains reachable. I've got the networking code on the Pi wrapped in an exception handler, and when it fails it shows the following: Ethernet problem: Traceback (most recent call last): File "garage.py", line 108, in module s.connect((host, port)) File "/usr/lib/python2.7/socket.py", line 224, in meth return getattr(self._sock,name)(*args) error: [Errno 113] No route to host None The relevant python code looks like: import socket import traceback host = '192.168.0.129' port = 31415 in the setup, and after serial data has been processed: try: bline = strline.encode('utf-8') s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((host, port)) s.send(bline) s.close() except: print "Ethernet problem: " print traceback.print_exc() Where strline contains the processed data. As I said, this runs fine for a few hours more or less before failing. Any ideas? EDIT: When PUTTY fails its error message is :Network Error: Software caused connection abort."

    Read the article

  • How to approach socket programming between C# -> Java (Android)

    - by Alex
    I've recently knocked up a server/client app for Windows & Android that allows one to send a file from Windows to an android phone over a socket connection. It works great for a single file but trying to send multiple files over in a single stream is causing me problems. I've also realised that aside from the binary data, I will need to send messages over the socket to indicate error states and other application messages. I have little experience with network programming and and wondering what is the best way forward. Basically the C# server side of the app just goes into a listening state and uses Socket.SendFile to transmit the file. On Android I use the standard Java Socket.getInputStream() to receive the file. That works great for a single file transfer, but how should I handle multiple files and error/messaging information? Do I need to use a different socket for each file? Should I be using a higher level framework to handle this or can I send everything over the single socket? Any other suggestions for frameworks or learning materials?

    Read the article

  • Server socket programming in Android 1.5, most power efficient way?

    - by Antek
    Hello people, I am doing a project where I have too develop an application that listens for incoming events by a service. The device that has to listen too events is an Android phone with Android SDK 1.5 on it. Currently the services that call events only implement communication trough UDP or TCP sockets. I can solve my problem by setting up a ServerSocket, but i doubt that's the most power efficient way. This application will be running most of the time, with Wi-Fi on, and I'd like too reach an long battery duration. I've been looking for options on the internet for my question for a while but i couldn't get a real answer. I've got the following questions: What is the most efficient way too listen to incoming events? Should I make an ServerSocket? or what are my options? Are there any other implementations that are more power efficient? Ive been also thinking of implementing communication trough XMPP. Not sure if this is the best way. I'm not forced too an specific implementation. All suggestions are welcome! Thanks for the help, Antek

    Read the article

  • Socket : can an asynchronous Receive returns without reading all the bytes I asked for?

    - by NorthWind
    Hi; I was reading an article on Vadym Stetsiak's blog about how to transfer variable length messages with async sockets (url: http://vadmyst.blogspot.com/2008/03/part-2-how-to-transfer-fixed-sized-data.html). He says : What to expect when multiple messages arrive at the server? While dealing with multiple messages one has to remember that receive operation can return arbitrary number of bytes being read from the net. Typically that size is from 0 to specified buffer length in the Receive or BeginReceive methods. So, even if I tell BeginReceive to read 100 bytes, it may read less than that and returns??? I am developing a network-enabled software (TCP/IP), and I always receive the same exact number of bytes I asked for. I don't even understand the logic : why would Receive completes asynchronously if it didn't get every byte I asked for ... just keep waiting. Maybe it has something to do with IP vs TCP? Thank you for your help.

    Read the article

  • Rewriting Live TCP/IP (Layer 4) (i.e. Socket Layer) Streams

    - by user213060
    I have a simple problem which I'm sure someone here has done before... I want to rewrite Layer 4 TCP/IP streams (Not lower layer individual packets or frames.) Ettercap's etterfilter command lets you perform simple live replacements of Layer 4 TCP/IP streams based on fixed strings or regexes. Example ettercap scripting code: if (ip.proto == TCP && tcp.dst == 80) { if (search(DATA.data, "gzip")) { replace("gzip", " "); msg("whited out gzip\n"); } } if (ip.proto == TCP && tcp.dst == 80) { if (search(DATA.data, "deflate")) { replace("deflate", " "); msg("whited out deflate\n"); } } http://ettercap.sourceforge.net/forum/viewtopic.php?t=2833 I would like to rewrite streams based on my own filter program instead of just simple string replacements. Anyone have an idea of how to do this? Is there anything other than Ettercap that can do live replacement like this, maybe as a plugin to a VPN software or something? I would like to have a configuration similar to ettercap's silent bridged sniffing configuration between two Ethernet interfaces. This way I can silently filter traffic coming from either direction with no NATing problems. Note that my filter is an application that acts as a pipe filter, similar to the design of unix command-line filters: >[eth0] <----------> [my filter] <----------> [eth1]< What I am already aware of, but are not suitable: Tun/Tap - Works at the lower packet layer, I need to work with the higher layer streams. Ettercap - I can't find any way to do replacements other than the restricted capabilities in the example above. Hooking into some VPN software? - I just can't figure out which or exactly how. libnetfilter_queue - Works with lower layer packets, not TCP/IP streams. Again, the rewriting should occur at the transport layer (Layer 4) as it does in this example, instead of a lower layer packet-based approach. Exact code will help immensely! Thanks!

    Read the article

  • php open_socket

    - by sea_1987
    Hello, I am trying to open a socket to use with secure tradings xpay api, however when I check to see if the socket is open I get error returned, Can't assign requested address I need to open up 127.0.0.1:5000 is there something wring with my code that means I cannot do this? if (isset($xpay_port) and ($socket=socket_create(AF_INET, SOCK_STREAM, SOL_TCP)) and (socket_connect($socket, $address, $port))) { $text="Connection successful on IP $address, port $port"; socket_close($socket); } else $text="Unable to connect<pre>".socket_strerror(socket_last_error())."</pre>"; echo "<html><head></head><body>". $text. "</body></html>";

    Read the article

  • Reading off a socket until end of line C#?

    - by Omar Kooheji
    I'm trying to write a service that listens to a TCP Socket on a given port until an end of line is recived and then based on the "line" that was received executes a command. I've followed a basic socket programming tutorial for c# and have come up with the following code to listen to a socket: public void StartListening() { _log.Debug("Creating Maing TCP Listen Socket"); _mainSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); IPEndPoint ipLocal = new IPEndPoint(IPAddress.Any, _port); _log.Debug("Binding to local IP Address"); _mainSocket.Bind(ipLocal); _log.DebugFormat("Listening to port {0}",_port); _mainSocket.Listen(10); _log.Debug("Creating Asynchronous callback for client connections"); _mainSocket.BeginAccept(new AsyncCallback(OnClientConnect), null); } public void OnClientConnect(IAsyncResult asyn) { try { _log.Debug("OnClientConnect Creating worker socket"); Socket workerSocket = _mainSocket.EndAccept(asyn); _log.Debug("Adding worker socket to list"); _workerSockets.Add(workerSocket); _log.Debug("Waiting For Data"); WaitForData(workerSocket); _log.DebugFormat("Clients Connected [{0}]", _workerSockets.Count); _mainSocket.BeginAccept(new AsyncCallback(OnClientConnect), null); } catch (ObjectDisposedException) { _log.Error("OnClientConnection: Socket has been closed\n"); } catch (SocketException se) { _log.Error("Socket Exception", se); } } public class SocketPacket { private System.Net.Sockets.Socket _currentSocket; public System.Net.Sockets.Socket CurrentSocket { get { return _currentSocket; } set { _currentSocket = value; } } private byte[] _dataBuffer = new byte[1]; public byte[] DataBuffer { get { return _dataBuffer; } set { _dataBuffer = value; } } } private void WaitForData(Socket workerSocket) { _log.Debug("Entering WaitForData"); try { lock (this) { if (_workerCallback == null) { _log.Debug("Initializing worker callback to OnDataRecieved"); _workerCallback = new AsyncCallback(OnDataRecieved); } } SocketPacket socketPacket = new SocketPacket(); socketPacket.CurrentSocket = workerSocket; workerSocket.BeginReceive(socketPacket.DataBuffer, 0, socketPacket.DataBuffer.Length, SocketFlags.None, _workerCallback, socketPacket); } catch (SocketException se) { _log.Error("Socket Exception", se); } } public void OnDataRecieved(IAsyncResult asyn) { SocketPacket socketData = (SocketPacket)asyn.AsyncState; try { int iRx = socketData.CurrentSocket.EndReceive(asyn); char[] chars = new char[iRx + 1]; _log.DebugFormat("Created Char array to hold incomming data. [{0}]",iRx+1); System.Text.Decoder decoder = System.Text.Encoding.UTF8.GetDecoder(); int charLength = decoder.GetChars(socketData.DataBuffer, 0, iRx, chars, 0); _log.DebugFormat("Read [{0}] characters",charLength); String data = new String(chars); _log.DebugFormat("Read in String \"{0}\"",data); WaitForData(socketData.CurrentSocket); } catch (ObjectDisposedException) { _log.Error("OnDataReceived: Socket has been closed. Removing Socket"); _workerSockets.Remove(socketData.CurrentSocket); } catch (SocketException se) { _log.Error("SocketException:",se); _workerSockets.Remove(socketData.CurrentSocket); } } This I thought was going to be a good basis for what I wanted to do, but the code I have appended the incoming characters to a text box one by one and didn't do anything with it. Which doesn't really work for what I want to do. My main issue is the decoupling of the OnDataReceived method from the Wait for data method. which means I'm having issues building a string (I would use a string builder but I can accept multiple connections so that doesn't really work. Ideally I'd like to look while listening to a socket until I see and end of line character and then call a method with the resulting string as a parameter. What's the best way to go about doing this.

    Read the article

  • Monitoring UDP socket in glib(mm) eats up CPU time

    - by Gyorgy Szekely
    Hi, I have a GTKmm Windows application (built with MinGW) that receives UDP packets (no sending). The socket is native winsock and I use glibmm IOChannel to connect it to the application main loop. The socket is read with recvfrom. My problem is: this setup eats 25% percent CPU time on a 3GHz workstation. Can somebody tell me why? The application is idle in this case, and if I remove the UDP code, CPU usage drops down to almost zero. As the application has to perform some CPU intensive tasks, I could image better ways to spend that 25% Here are some code excerpts: (sorry for the printf's ;) ) /* bind */ void UDPInterface::bindToPort(unsigned short port) { struct sockaddr_in target; WSADATA wsaData; target.sin_family = AF_INET; target.sin_port = htons(port); target.sin_addr.s_addr = 0; if ( WSAStartup ( 0x0202, &wsaData ) ) { printf("WSAStartup failed!\n"); exit(0); // :) WSACleanup(); } sock = socket( AF_INET, SOCK_DGRAM, 0 ); if (sock == INVALID_SOCKET) { printf("invalid socket!\n"); exit(0); } if (bind(sock,(struct sockaddr*) &target, sizeof(struct sockaddr_in) ) == SOCKET_ERROR) { printf("failed to bind to port!\n"); exit(0); } printf("[UDPInterface::bindToPort] listening on port %i\n", port); } /* read */ bool UDPInterface::UDPEvent(Glib::IOCondition io_condition) { recvfrom(sock, (char*)buf, BUF_SIZE*4, 0, NULL, NULL); /* process packet... */ } /* glibmm connect */ Glib::RefPtr channel = Glib::IOChannel::create_from_win32_socket(udp.sock); Glib::signal_io().connect( sigc::mem_fun(udp, &UDPInterface::UDPEvent), channel, Glib::IO_IN ); I've read here in some other question, and also in glib docs (g_io_channel_win32_new_socket()) that the socket is put into nonblocking mode, and it's "a side-effect of the implementation and unavoidable". Does this explain the CPU effect, it's not clear to me? Whether or not I use glib to access the socket or call recvfrom() directly doesn't seem to make much difference, since CPU is used up before any packet arrives and the read handler gets invoked. Also glibmm docs state that it's ok to call recvfrom() even if the socket is polled (Glib::IOChannel::create_from_win32_socket()) I've tried compiling the program with -pg and created a per function cpu usage report with gprof. This wasn't usefull because the time is not spent in my program, but in some external glib/glibmm dll.

    Read the article

  • How can I delete a file created and opened with Perl's IO::File and XML::Writer?

    - by Sho Minamimoto
    So I'm running through a list of things and have code that creates an .xml files with IO::File called $doc, then I make a new writer with XML::Writer(OUTPUT => $doc). More code runs and I build a big XML file with XML::Writer. Then, near the end of the file, I find out if I need this file at all. If I do need it, I just: $writer->end(); $doc->close(); but if I don't need it, what should I enter to just delete all data I've stored/saved and move onto the next file? I tried unlink($docpath) (before and after $doc->close()), the file was not deleted.

    Read the article

  • Perl, deleting an .xml file created and open with IO::File and XML::Writer?

    - by Sho Minamimoto
    So I'm running through a list of things and have code that creates an .xml file with IO::File called $doc, then I make a new writer with XML::Writer(OUTPUT = $doc). More code runs and I build a big xml file with XML::Writer. Then, near the end of the file, I find out if I need this file at all. If I do need it, I just $writer-end(); $doc-close(); but if I don't need it, what should I enter to just delete all data I've stored/saved and move onto the next file? I tried unlink($docpath) (before and after $doc-close()), the file was not deleted.

    Read the article

  • How to use a self-signed SSL certificate when developing with Trigger.io?

    - by user610345
    Our backend is in rails, and for several reasons the development environment has to be run with rails using a self-signed SSL certificate. This works fine on the desktop after manually trusting the certificate. Using Trigger.io, we're developing a mobile application targeting iOS from the same backend. It would be ideal for us to be able to run the rails server with SSL (so we can compare the browser output) and still have the iOS simulator connect properly without complaining about invalid certs. Production is using a proper ssl-cert, but what's the best way to set up the simulator?

    Read the article

  • High server load - [jbd2/md1-8] using 99.99% IO

    - by Alex
    I've been having spike in load over the last week. This usually occurs once or twice a day. I've managed to identify from iotop that [jbd2/md1-8] is using 99.99 % IO. During the high load times there is no high traffic to the server. Server specs are: AMD Opteron 8 core 16 GB RAM 2x2.000 GB 7.200 RPM HDD Software Raid 1 Cloudlinux + Cpanel Mysql is properly tuned Apart from the spikes, the load usually is around 0.80 at most. I've searched around but can't find what [jbd2/md1-8] does exactly. Has anyone had this problem or does anyone know a possible solution? Thank you. UPDATE: TIME TID PRIO USER DISK READ DISK WRITE SWAPIN IO COMMAND 16:05:36 399 be/3 root 0.00 B/s 38.76 K/s 0.00 % 99.99 % [jbd2/md1-8]

    Read the article

  • Regarding compatibility of Intel Pentium D 805 CPU with new motherboard

    - by aniruddhabhide
    I currently have an old configuration with Intel Pentium D 805 CPU and Intel D101GGC chipset. Now I am planning to upgrade my system except CPU and hard disk since it doesn't fit in the budget. QUESTION: I am planning to get Gigabyte GA-B75M-D3H Motherboard which has LGA1155 socket. But my processor has PLGA775 socket type. Will my CPU fit in thee new motherboard's socket? LINKS: CPU specs (Intel site): http://ark.intel.com/products/27511/Intel-Pentium-D-Processor-805-2M-Cache-2_66-GHz-533-MHz-FSB New Motherboard specs (Vendor site): http://www.flipkart.com/gigabyte-ga-b75m-d3h-motherboard/p/itmdacp36gegyeqt?pid=MBDDACP2GUBGFPFM

    Read the article

  • VMware Server guest systems are extremely slow with IO load on host (Ubuntu 8.04)

    - by Dennis G.
    We are experiencing performance issues with a VMware Server 2.x installation on an Ubuntu 8.04 host. When the host system is generating IO load (for example, copying large files as part of a backup operation), the guests (also Ubuntu 8.04) become extremely unresponsive and slow (simple Apache HTTP requests taking 5 seconds instead of the usual 200ms). We tried optimizing various aspects of the VMs, but the issue remains. Is there a known bug with VMware performance under linux if host IO load is high? Is there a way to fix this? Is this only an issue with Ubuntu systems, or have you seen it on other systems before? Thanks!

    Read the article

  • Linux IO scheduler on databases with RAID

    - by Raghu
    Hi, I have a linux database(MySQL) server(Dell 2950) with a 6-disk RAID 10. The default IO scheduler on it is CFQ. However, from what I have read and heard, there is no need for a scheduler like CFQ when reordering/scheduling is also done by underlying RAID controller; on the contrary since it does not account underlying RAID configuration into account performance may actually degrade with CFQ. The primary concern is to reduce CPU usage and improve throughput. Also, I have seen recommendations of using noop/deadline IO scheduler for databases primarily because of the nature of their R/W access.

    Read the article

< Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >