J2ME를 사용하는 Bluetooth API를 사용하여 서버를 구현할 계획입니다. 여러 클라이언트가 동시에 연결할 수 있기를 원하지만 NET에서 그다지 많은 것을 찾을 수 없었습니다.j2me에서 블루투스 API를 사용하는 멀티 클라이언트 서버를 만드는 방법은 무엇입니까?
UUID uuid = new UUID("1101", false);
String SurveyAnswer="";
//Create the service url
String connectionString = "btspp://localhost:" + uuid + ";name=xyz";
//open server url
StreamConnectionNotifier streamConnNotifier = (StreamConnectionNotifier) Connector.open(connectionString);
//Wait for client connection
System.out.println("\nServer Started. Waiting for clients to connect...");
while(true){
StreamConnection connection = streamConnNotifier.acceptAndOpen();
}
어떻게 이러한 코드를 수정하여 다중 클라이언트 서버로 사용할 수 있습니까?
코드의 오류는 무엇입니까? – funkybro
한 번에 하나의 피어 만 연결할 수 있습니다. 피어가 서비스에 연결하려고하고 다른 피어의 요청이 처리 될 때 전자는 요청이 처리 될 때까지 대기해야합니다. –