localhost の 2 つのポート間でソケット経由でチャット メッセージを送信するプログラムを作成しました。xmpp プロトコルを使用して localhost に接続し、ここにメッセージを送信する 3 番目のクライアントが必要です。ターミナルでサーバーを実行すると、この 3 番目のクライアントが接続済みとして表示されます。
私のコードは以下のとおりです。
import xmpp
msg='how r u :)'
client = xmpp.Client('localhost')
print "clienttttttttttttttttttt",client
con=client.connect(server=('localhost',5000))
#client.auth(username, passwd, 'botty')
#client.sendInitPresence()
message = xmpp.Message('localhost', msg)
print "messageeeeeeeeeeeeeeeeeeee",message
message.setAttr('type', 'chat')
client.send(message)
このコードを実行すると、このエラーが発生します
Registering protocol "error" as <class 'xmpp.protocol.Protocol'>(http://etherx.jabber.org/streams)
DEBUG: socket sent <?xml version='1.0'?>
<stream:stream xmlns="jabber:client" to="localhost" version="1.0" xmlns:stream="http://etherx.jabber.org/streams" >
Python xmpppy ライブラリを使用しています。ここでの問題は何ですか。ソケットを使用してメッセージを送信する localhost にメッセージを送信するにはどうすればよいですか?助けてください????