TAILIEUCHUNG - BLUETOOTH APPLICATION PROGRAMMING WITH THE JAVA APIS ESSENTIALS EDITION PHẦN 5

Một khách hàng có thể kết thúc một PUT và GET yêu cầu trong quá trình hoạt động bằng cách gọi phương pháp hủy bỏ (). Phương pháp hủy bỏ () sẽ gửi một yêu cầu hủy bỏ vào máy chủ | 106 Chapter Five OBEX Verify that the whole object was received int responseCode switch responseCode case return case case Since nothing was found return null return null default throw new IOException Request Failed Figure Phases of a GET operation. Programming with the API 107 A client can end a PUT and GET request during the operation by calling the abort method. The abort method sends an ABORT request to the server and signals to the server the request should not be processed. The abort method closes the Inputstream Outputstream and Operation object. If the operation has already ended the abort method throws an lOException. Receiving a Request from a Client OBEX servers are similar to Java servlets once the transport layer connection is established. HTTP servlets extend HttpServlet OBEX servers extend the ServerRequestHandler class. Unlike HttpServlet the serverRequestHandler class does not require any methods to be overridden. OBEX servers need only to override the methods for the type of client requests the server would like to handle. For example if the OBEX server wants only to process CONNECT SETPATH and PUT requests the server needs only to override the onConnect onSet-Path and onPut methods. If the client makes a DELETE or GET request the implementation on the server side would automatically respond with the OBEX_HTTP_NOT_IMPLEMENTED response code. Table shows how OBEX requests are received by an application and how the implementation will respond if the method is not overridden. The onConnect onDelete and onDisconnect methods allow servers to respond to OBEX CONNECT DELETE and DISCONNECT requests respectively. All three methods have two arguments. The Table How OBEX Requests Are Translated to Methods by the JABWT Implementation OBEX Request ServerRequestHandler CONNECT onConnect SETPATH

TỪ KHÓA LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.