Changeset 104:a41f04cda4c2 in xplra for src/plugin
- Timestamp:
- 12/15/22 19:15:24 (23 months ago)
- Branch:
- default
- Phase:
- public
- Location:
- src/plugin/src/xplra
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
src/plugin/src/xplra/ListenThread.cc
r61 r104 1 // Copyright (c) 20 13by István Váradi1 // Copyright (c) 2022 by István Váradi 2 2 3 3 // This file is part of XPLRA, a remote-access plugin for X-Plane … … 35 35 #include <hu/varadiistvan/scpl/io/LocalServerSocket.h> 36 36 #include <hu/varadiistvan/scpl/io/LocalAcceptor.h> 37 #include <hu/varadiistvan/scpl/io/TCPServerSocket.h> 38 #include <hu/varadiistvan/scpl/io/TCPAcceptor.h> 37 39 #include <hu/varadiistvan/xplcommon/Util.h> 38 40 … … 43 45 using hu::varadiistvan::scpl::io::LocalServerSocket; 44 46 using hu::varadiistvan::scpl::io::LocalAcceptor; 47 using hu::varadiistvan::scpl::io::TCPServerSocket; 48 using hu::varadiistvan::scpl::io::TCPAcceptor; 45 49 using hu::varadiistvan::xplcommon::Util; 46 50 … … 51 55 Util::debug("xplra::ListenThread::run: started\n"); 52 56 53 LocalServerSocket socket("xplra", &waiter); 54 LocalAcceptor& acceptor = socket.getAcceptor(); 55 while(!quitEvent.check() && !quitEvent.failed() && !acceptor.failed()) { 56 while (acceptor.accept()) { 57 LocalServerSocket localSocket("xplra", &waiter); 58 LocalAcceptor& localAcceptor = localSocket.getAcceptor(); 59 60 TCPServerSocket tcpSocket(defaultTCPPort, &waiter); 61 TCPAcceptor& tcpAcceptor = tcpSocket.getAcceptor(); 62 63 while(!quitEvent.check() && !quitEvent.failed() && 64 !localAcceptor.failed() && !tcpAcceptor.failed()) { 65 while (localAcceptor.accept()) { 57 66 ServerThread* serverThread = new ServerThread(*this, 58 67 requestQueue, 59 acceptor); 68 localAcceptor); 69 serverThread->start(); 70 } 71 while (tcpAcceptor.accept()) { 72 ServerThread* serverThread = new ServerThread(*this, 73 requestQueue, 74 tcpAcceptor); 60 75 serverThread->start(); 61 76 } -
src/plugin/src/xplra/ListenThread.h
r46 r104 56 56 class ListenThread : public hu::varadiistvan::scpl::Thread 57 57 { 58 public: 59 /** 60 * The default TCP port number ("XR") 61 */ 62 static const unsigned short defaultTCPPort = 0x5852; 63 58 64 private: 59 65 /** -
src/plugin/src/xplra/Makefile.am
r91 r104 72 72 win_xpl_SOURCES=$(SRCS) 73 73 74 win_xpl_LDADD=$(LIBXPLCOMMON_LIBS) $(VSCPL_LIBS) 74 win_xpl_LDADD=$(LIBXPLCOMMON_LIBS) $(VSCPL_LIBS) -lws2_32 75 75 win_xpl_LDADD+=@XPSDK_LDFLAGS@ 76 76 if TARGET_API_WIN64 -
src/plugin/src/xplra/ServerThread.cc
r81 r104 54 54 using xplra::ServerThread; 55 55 56 using hu::varadiistvan::scpl::io:: LocalAcceptor;56 using hu::varadiistvan::scpl::io::BufferedStreamAcceptor; 57 57 using hu::varadiistvan::scpl::Mutex; 58 58 using hu::varadiistvan::xplcommon::Util; … … 97 97 98 98 ServerThread::ServerThread(ListenThread& listenThread, 99 RequestQueue& requestQueue, LocalAcceptor& acceptor) : 99 RequestQueue& requestQueue, 100 BufferedStreamAcceptor& acceptor) : 100 101 listenThread(listenThread), 101 102 requestQueue(requestQueue), 102 bufferedStream(acceptor.get Socket(&waiter)),103 bufferedStream(acceptor.getAcceptedBufferedStream(&waiter)), 103 104 stream(*bufferedStream), 104 105 nextGetMultiRequestID(1), -
src/plugin/src/xplra/ServerThread.h
r81 r104 38 38 #include <hu/varadiistvan/scpl/io/BufferedStream.h> 39 39 #include <hu/varadiistvan/scpl/io/DataStream.h> 40 #include <hu/varadiistvan/scpl/io/ LocalAcceptor.h>40 #include <hu/varadiistvan/scpl/io/BufferedStreamAcceptor.h> 41 41 42 42 #include <hu/varadiistvan/scpl/Mutex.h> … … 154 154 */ 155 155 ServerThread(ListenThread& listenThread, RequestQueue& requestQueue, 156 hu::varadiistvan::scpl::io:: LocalAcceptor& acceptor);156 hu::varadiistvan::scpl::io::BufferedStreamAcceptor& acceptor); 157 157 158 158 /**
Note:
See TracChangeset
for help on using the changeset viewer.