Menu
  • HOME
  • TAGS

C, 'fork: resource temporarily unavailable' on TCP server

c,fork,tcpserver

It's a fork bomb because you never terminates the child, so it continues to run by looping in the while where accept() gives an error but doesn't terminates the process. So it continues to fork() and doing so forever. Modify the code like this: if (pid == 0) { close...

How to set in PERL recv timeout in my code?

perl,sockets,tcp,tcpserver,tcpsocket

Perhaps I am misunderstanding the question, but have you tried setting a timeout in the socket with "Timeout"? See IO::Socket::INET. EDIT: I did not catch the 'recv' bit. You have to use setsockopt, which is not wholly portable, so the final answer is somewhat dependent on your platform. Here are...

Unable to receive response from TIdTCPServer using TIdTCPClient

delphi,tcpclient,indy,tcpserver

There is nothing wrong with the code you have shown, so the problem has to be in the code you have not shown. The way I see it, there are two possibilities: If you are not setting wantedHost and/or wantedPort to the correct values, you would not actually be connecting...

WSAENETDOWN SocketException on a FEZ Spider kit

c#,sockets,tcpserver,.net-micro-framework

I've solved the problem: Change IPAddress.Any to a static IP,e.g. IPAddress.Parse("192.168.0.8"). Delay Bind by adding Thread.Sleep(3000) right before it. It seems that the interface's network settings configuration takes some time. ...

Trying to create a server that will receive more than 1 file, but it always stops after receiving 1 file

c#,sockets,tcp,tcpclient,tcpserver

From what i can spot out as being erroneus is that your current code misses a while() loop in the StartServerWorker_DoWork() function. Currently you are just starting to listen, get file, and even close it, no wonder you don't get the second file from client. See this example for basic...

TCP Chat server Python 3.4

python,python-3.x,tcpserver

On Microsoft Windows, python's socket library is implemented using Winsock. Winsock isn't integrated into the operating system like the sockets library on unixy systems. It has its own idea of what a socket is, and does not recognize system pipes or consoles. On Windows you get the error you see...

TCP server- connection handling

c#,multithreading,sockets,tcpserver

Basically, don't use a thread per socket; use one of the async APIs (BeginReceive / ReceiveAsync), or some kind of socket polling (Socket.Select for example, although note that this is implemented in a very awkward way; when I use this, I actually use P/Invoke to get to the raw underlying...

TCP server not receiving all data being sent

c#,xml,tcp,server,tcpserver

You seem to be expecting to receive an entire XML document - and exactly the XML document - each time you call Stream.Read. That's a really, really dangerous assumption. The stream is a stream of data - while it'll be segmented into packets for transmission, you shouldn't expect to receive...

Stopping SocketServer with blocking handle

python,python-multithreading,tcpserver

The best solution I found was to use SocketServer.ForkingMixIn instead of SocketServer.ThreadingMixIn. This way the daemon actually works, even though using processes instead of threads was not exactly what I wanted....

Ruby: Establish client connection on particular URI path with ruby TCPSocket

ruby,sockets,websocket,tcpserver,tcpsocket

To put a bit more context to Steffen Ullrich's answer: This can't be done in the way you imagine (or ask) it to be done. The part of the URL you are asking about (/the/path) - known as the URI, "Unique Resource Identifier" - is HTTP specific and isn't applicable...

Indy TCPServer OnExecute analog of HTTPServer OnCommandGet

delphi,indy,tcpserver

TIdHTTPServer does not trigger an OnCommand... event until it has read a complete HTTP request from the client. Your TIdTCPServer is not reading any requests at all. TIdTCPServer.OnExecute is a looped event. It is triggered continuously for the lifetime of the connection. It is the event handler's responsibility to decide...

In a Chrome app cannot unpause TCP connection for TCP server

javascript,sockets,tcp,google-chrome-app,tcpserver

As mentioned in my final edit, I found a workaround: I used this script instead: https://github.com/GoogleChrome/chrome-app-samples/blob/master/tcpserver/tcp-server.js It does everything I need and it's much easier to use and configure. It just seems that the built-in TCP server is not functional as per the current version of Chrome, Chrome 34....

Delphi XE2 / Indy TIdTCPServer / “Connection reset by peer”

delphi,delphi-xe2,indy,tcpserver

Your Clients list is not protected from multithreaded access. TIdTCPServer is a multi-threaded component, each client runs in its own worker thread. You need to take that into account. I suggest you get rid of your Clients list altogether and use the TIdTCPServer.Contexts property instead. Otherwise, you need to protect...

TCP Server with multiple connections in PERL based on specific code

perl,tcp,tcpserver

There are two key ways of handling multiple sockets. The first is - making use of IO::Select - which has a can_read function - this allows you to test whether a socket has data to read, and you can just iterate your socket list. Read the doc on IO::Select, as...

Any String concat with previous one not showing VB.NET

vb.net,string-concatenation,tcpserver

The issue is that you are converting the entire Byte array to a String when only part of the array was populated from the Stream. That means that your String has null characters at the end of it. If you append text to that String then the String object will...

Connecting to Node.js server on azure virtual machine

node.js,azure,virtual-machine,tcpserver

When you bind your HTTP server to the address 127.0.0.1, you are listening for incoming requests only on the local loopback interface. This means that any requests coming from other devices, even if on the same network, will be unable to reach your service. Omitting the IP address will cause...

Connect to pressure sensor using c# to get the value ,doesn't work in c#

c#,sockets,listener,tcpclient,tcpserver

In your screenshots, PC is a master device (it opens a listening server socket), and the sensor is a slave. While your code assumes, that PC tries to connect to a sensor as a client. The minimal code snippet is this: var listener = new TcpListener(IPAddress.Any, 3000); listener.Start(); using (var...

Java sockets act strange

java,sockets,tcp,tcpserver

.read returns the number of bytes read. You need to check it before using the buffer. In your case, it is, probably, -1, meaning, that the client has not sent any data

Read from NetworkStream to delimiter

c#,tcpserver

If you just want to read a line then use StreamReader on your NetworkStream and then call the ReadLine method provided by it. Something like this NetworkSTream strm = client.GetStream(); var reader = new StreamReader(strm); var line = reader.ReadLine() ...

NHibernate and the Unit of Work pattern in game server with persistent user connections

c#,nhibernate,unit-of-work,tcpserver

You can attach to the session the detached object, see http://rmfusion.com/open_source/nhibernate/nhibernate_net_object_persistence.htm here said by reattaching the object to a new Persistent Manager (ISession). The object state will then be synchronized with the database again, at the end of the transaction. There are other orm such entity framework, but depend of...

Indy 10 TidTCPServer encoding characters

delphi-xe2,indy10,tcpserver

By default, Indy uses 7bit ASCII as its character encoding (for compatibility with various Internet protocols). To use a different character encoding, you need to either: set the IOHandler.DefStringEncoding property before doing any reading/writing. The string-based I/O methods will then use this encoding by default. // note: use TIdTextEncoding.UTF8 if...

HTML5 web sockets - how to communicate with them?

ruby,html5,sockets,tcpserver,handshaking

I've tested many web socket examples .... From what you describe you did not use "web sockets" but simply "sockets", e.g. direct TCP/IP. WebSockets (e.g. what you call "HTML web sockets") are different: they are used to create something socket like over an established HTTP connection. Therefore you see...