亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

ディレクトリ 検索
android Manifest Manifest.permission Manifest.permission_group android.accessibilityservice AccessibilityService android.accounts Account android.app NotificationManager android.bluetooth BluetoothAdapter BluetoothClass BluetoothClass.Device BluetoothClass.Device.Major BluetoothClass.Service BluetoothDevice BluetoothServerSocket BluetoothSocket android.content SharedPreferences android.database.sqlite SQLiteCursorDriver SQLiteOpenHelper android.graphics Bitmap android.location LocationListener Geocoder GpsStatus GpsStatus.Listener GpsStatus.NmeaListener GpsSatellite android.media AudioFormat AsyncPlayer AudioRecord AudioRecord.OnRecordPositionUpdateListener ThumbnailUtils AudioManager android.net TrafficStats MailTo LocalSocket android.os AsyncTask AsyncTask.Status CountDownTimer Message MessageQueue HandlerThread android.text Html android.util JsonWriter android.view ContextMenu ContextMenu.ContextMenuInfo Display ViewManager View ViewStub ViewTreeObserver ViewParent WindowManager GestureDetector Gravity MenuInflater ScaleGestureDetector SoundEffectConstants android.view.inputmethod InputConnection InputMethod InputMethodSession BaseInputConnection InputMethodManager android.widget AbsListView AbsListView.LayoutParams AbsListView.OnScrollListener AbsListView.RecyclerListener AbsoluteLayout AbsoluteLayout.LayoutParams AbsSeekBar AbsSpinner AdapterView AdapterView.AdapterContextMenuInfo AdapterView.OnItemLongClickListener AdapterView.OnItemSelectedListener AdapterView.OnItemClickListener AnalogClock BaseAdapter BaseExpandableListAdapter Button CheckBox CheckedTextView Checkable Chronometer Chronometer.OnChronometerTickListener CompoundButton CompoundButton.OnCheckedChangeListener CursorAdapter CursorTreeAdapter DatePicker DatePicker.OnDateChangedListener DialerFilter DigitalClock EditText Filter Filter.FilterListener Filter.FilterResults ExpandableListAdapter ExpandableListView.OnChildClickListener ExpandableListView.OnGroupClickListener ExpandableListView.OnGroupCollapseListener ExpandableListView.OnGroupExpandListener Filterable Gallery Gallery.LayoutParams GridView GridLayout GridLayout.Alignment RadioGroup ImageView ImageView.ScaleType HorizontalScrollView ImageButton ImageSwitcher FilterQueryProvider ListAdapter ListView MediaController MultiAutoCompleteTextView MultiAutoCompleteTextView.CommaTokenizer MultiAutoCompleteTextView.Tokenizer QuickContactBadge RadioButton RatingBar RatingBar.OnRatingBarChangeListener RelativeLayout RemoteViews ResourceCursorAdapter ResourceCursorTreeAdapter Scroller ScrollView SearchView SearchView.OnCloseListener SearchView.OnQueryTextListener SearchView.OnSuggestionListener SeekBar SeekBar.OnSeekBarChangeListener SimpleAdapter SimpleAdapter.ViewBinder SimpleCursorAdapter SimpleCursorAdapter.CursorToStringConverter SimpleCursorAdapter.ViewBinder SimpleCursorTreeAdapter SimpleCursorTreeAdapter.ViewBinder SimpleExpandableListAdapter SlidingDrawer SlidingDrawer.OnDrawerCloseListener SlidingDrawer.OnDrawerOpenListener SlidingDrawer.OnDrawerScrollListener Spinner SpinnerAdapter WrapperListAdapter TabHost TabHost.TabSpec TextView TimePicker TimePicker.OnTimeChangedListener Toast TableLayout TableLayout.LayoutParams TableRow TableRow.LayoutParams TabWidget TextSwitcher ToggleButton TwoLineListItem VideoView ViewAnimator ViewFlipper ViewSwitcher ViewSwitcher.ViewFactory ZoomButtonsController ZoomButtonsController.OnZoomListener ZoomButton ZoomControls dalvik.system DexFile
テキスト


BluetoothServerSocket

版本:Android 2.3 r1

?

結構

繼承關系

public final class BluetoothServerSocket extends Object implements Closeable

????????

java.lang.Object

android.bluetooth.BluetoothServerSocket

?

類概述

???????? 一個藍牙監(jiān)聽端口。

???????? 藍牙端口監(jiān)聽接口和TCP端口類似:SocketServerSocket類。在服務器端,使用BluetoothServerSocket類來創(chuàng)建一個 監(jiān)聽服務端口。當一個連接被BluetoothServerSocket所接受,它會返回一個新的BluetoothSocket來管理該連接。在客戶 端,使用一個單獨的BluetoothSocket類去初始化一個外接連接和管理該連接。

???????? 最通常使用的藍牙端口是RFCOMM,它是被Android API支持的類型。RFCOMM是一個面向連接,通過藍牙模塊進行的數據流傳輸方式,它也被稱為串行端口規(guī)范(Serial Port Profile,SPP)。

???????? 為了創(chuàng)建一個對準備好的新來的連接去進行監(jiān)聽BluetoothServerSocket類,使用 BluetoothAdapter.listenUsingRfcommWithServiceRecord()方法。然后調用accept()方法去監(jiān) 聽該鏈接的請求。在連接建立之前,該調用會被阻斷,也就是說,它將返回一個BluetoothSocket類去管理該連接。每次獲得該類之后,如果不再需 要接受連接,最好調用在BluetoothServerSocket類下的close()方法。關閉BluetoothServerSocket類不會關 閉這個已經返回的BluetoothSocket類。

???????? BluetoothSocket類線程安全。特別的,close()方法總會馬上放棄外界操作并關閉服務器端口。

???????? 注意:需要BLUETOOTH權限。

???????? 參見

?????????????????? BluetoothSocket

?

公共方法

public BluetoothSocket accept (int timeout)

???????? 阻塞直到超時時間內的連接建立。

???????? 在一個成功建立的連接上返回一個已連接的BluetoothSocket類。

???????? 每當該調用返回的時候,它可以在此調用去接收以后新來的連接。

???????? close()方法可以用來放棄從另一線程來的調用。

?????????????????? 參數

?????????????????? ???????? timeout??? (譯者注:阻塞超時時間)

?????????????????? 返回值

??????????????????????????? 已連接的 BluetoothSocket

?????????????????? 異常

??????????????????????????? IOException???? 出現錯誤,比如該調用被放棄,或者超時。

?

public BluetoothSocket accept ()

???????? 阻塞直到一個連接已經建立。(譯者注:默認超時時間設置為-1,見源碼)

???????? 在一個成功建立的連接上返回一個已連接的BluetoothSocket類。

???????? 每當該調用返回的時候,它可以在此調用去接收以后新來的連接。

???????? close()方法可以用來放棄從另一線程來的調用。

?????????????????? 返回值

??????????????????????????? 已連接的 BluetoothSocket

?????????????????? 異常

??????????????????????????? IOException???? 出現錯誤,比如該調用被放棄,或者超時。

?

???????? public void close ()

馬上關閉端口,并釋放所有相關的資源。

在其他線程的該端口中引起阻塞,從而使系統馬上拋出一個IO異常。

關閉BluetoothServerSocket不會關閉接受自accept()的任意BluetoothSocket。

異常

IOException


前の記事: 次の記事: