Pudu programming language
Menu

Std.Http.Server.Socket.accept

1 declaration

fn

accept: &Std.Http.Server.Route.Request -> &Array[Str] -> Result[Std.Http.Response, Std.Http.Server.Socket.SocketError]

This is a callable function.

What it does

The answer that agrees to a lasting connection, or the reason it is refused.

The permitted origins are a parameter rather than a step that can be

omitted. A lasting connection is not subject to the rule that stops one

site reading another's answers: a page on any site can open one to any

server and it carries the viewer's cookies when it does. A server that

upgrades whoever asks has given every site an authenticated connection to

it, and the viewer sees nothing.

Read the signature

  • The text after the name is the type checked by Pudu.
  • Read arrows from left to right: inputs come first, and the final type is returned.
  • & borrows a value for this call instead of moving or copying it.
  • Names inside [ ] are type arguments, such as the item type held by a collection.
  • Result makes success and recoverable failure part of the function's type.

Back to Std.Http.Server.SocketSearch related declarations