Say I have an infinite Stream:

```
Stream<Socket> stream = Stream.generate(() -> {
    try {
        return serverSocket.accept();
    } catch (IOException e) {
        throw new RuntimeException(e);
    }
});

```

I want to be able to use it kind of like this:

```
stream.forEach(socket -> {
    new Thread(() -> {
        socket.getOutputStream().write("Hi there, client.");
    });
});

```

But this doesn't seem to work, and it's probably because I'm misunderstanding a critical aspect of Java 8 Streams. What am I doing wrong?