The server has five seconds to serve legally. As long as no swinging action is used to attempt the serve, the server may toss and catch a faulty toss. If the server uses any sort of swing in attempting the serve, they have violated section 2 of the Rules of Tennis and should receive a free point.