How to retain one million simultaneous TCP connections?

What operating systems are you considering for this? If using a Windows OS and using something later than Vista then you shouldn’t have a problem with many thousands of connections on a single machine. I’ve run tests (here: http://www.lenholgate.com/blog/2005/11/windows-tcpip-server-performance.html) with a low spec Windows Server 2003 machine and easily achieved more than 70,000 active TCP … Read more

Example TCP server written in Rust [closed]

Here is a very simple example using std::net. It was developed against the current master of Rust and should work on 1.* also. Be careful with this example; it is simplified; you may not want it to panic if binding, listening or accepting produce an error. use std::io::Write; use std::net::TcpListener; use std::thread; fn main() { … Read more

Why is it not possible to fake an IP address?

It is fully possible to send data with a fake sender IP. You’ll have a hard time getting replies though, since the replies will be sent to the fake IP and never reach you. Additionally, if you send data with a “from” IP that a router doesn’t expect to arrive from you, the router will … Read more

UDP vs IP- difference?

Then what is the point of UDP when we already have IP? To multiplex services. The UDP port number can differentiate between multiple services on the same host, using the same L3 identification. Using IP only it wouldn’t be possible to host multiple services on the same station and easily differentiate between them. Also, consider … Read more

Assigning TCP/IP Ports for In-House Application Use

Ports 0-1023 are the Well Known Ports and are assigned by IANA. These should only be used for the assigned protocols on public networks. Ports 1024-65535 used to be called Registered Port Numbers (see rfc1700) but are now split into two areas (see rfc6335). Ports 1024-49151 are the User Ports and are the ones to … Read more

Difference between push and urgent flags in TCP

They are two vastly different mechanisms. ###PSH and the PUSH function When you send data, your TCP buffers it. So if you send a character it won’t send it immediately but wait to see if you’ve got more. But maybe you want it to go straight on the wire: this is where the PUSH function … Read more

How to know TCP connection is closed in net package?

That thread “Best way to reliably detect that a TCP connection is closed”, using net.Conn for ‘c‘ (also seen in utils/ping.go or locale-backend/server.go or many other instances): one := make([]byte, 1) c.SetReadDeadline(time.Now()) if _, err := c.Read(one); err == io.EOF { l.Printf(logger.LevelDebug, “%s detected closed LAN connection”, id) c.Close() c = nil } else { … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)