Onionr/onionr/onionrchat.py

31 lines
1.1 KiB
Python
Raw Normal View History

'''
Onionr - P2P Anonymous Storage Network
Onionr Chat Messages
'''
'''
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
'''
2018-09-20 17:04:58 +00:00
import logger, time
class OnionrChat:
2018-09-20 17:41:34 +00:00
def __init__(self, communicatorInst, socketID):
2018-09-20 17:04:58 +00:00
self.communicator = communicatorInst
2018-09-20 17:41:34 +00:00
self.socket = self.communicator.sockets[socketID]
2018-09-20 17:04:58 +00:00
while True:
time.sleep(2)
2018-09-20 17:41:34 +00:00
logger.info('Chat: got %s' % (self.socket.getReadData(),))
time.sleep(1)
self.socket.addSendData('rekt')
2018-09-20 17:04:58 +00:00
return