chat

Async chat server buffer issue

半城伤御伤魂 提交于 2019-12-06 09:02:17
问题 can someone please help me out with this... I've been struggling all day. So I'm trying to learn Async sockets which is something that's been giving me trouble. The issue is basically the way I'm updating the ListBox with people who have joined the chat room's names: Basically what I'm doing is having each client send "!!addlist [nickname]" when they join the server. It's not ideal as it doesn't check for duplicates etc. but now I just want to know why it won't work. Whenever somebody adds a

Auto refresh table without refreshing page PHP MySQL

↘锁芯ラ 提交于 2019-12-06 08:29:01
问题 I have a very simple chat system I've built using PHP and MySQL (this is my second day ever using these languages) and I am wondering if there is any way to auto refresh the table data I'm pulling from my database and loading into an html table via PHP without having something like Javascript go and reload the whole web page... just reloading the html table with the data in it that PHP filled it up with.... Does that make sense? Here is my code if it helps (for /chat.php) <html><head></head>

Delivery receipt requests not working for XMPP Android (aSmack)

感情迁移 提交于 2019-12-06 06:24:44
问题 I'm using OpenFire with aSmack. I can't seem to get DeliveryReceipts working. I do the following when I create a connection: //create connection connection.login(username, password); DeliveryReceiptManager.getInstanceFor(connection).enableAutoReceipts(); DeliveryReceiptManager.getInstanceFor(connection).addReceiptReceivedListener(new ReceiptReceivedListener() { @Override public void onReceiptReceived(String arg0, String arg1, String arg2) { Log.v("app", arg0 + ", " + arg1 + ", " + arg2); } })

Multiple attachment in quickblox android

百般思念 提交于 2019-12-06 06:19:05
I want to upload video with it's thumbnail but unable to attach multiple files together. In android there is no way to get thumbnail of video from remote url without downloading it. Is there any way in quickblox for getting thumbnail of video ? Or is there anyway I can send thumbnail of video with the video file attachment ? Or can I send multiple attachment in quickblox ? Please provide details for this . I have searched a lot regarding this but did not find any solution. If there is any alternate way for getting thumbnail of video please provide the soltution. Thanks. Yes, you can send

Converse.js render into a container

让人想犯罪 __ 提交于 2019-12-06 06:17:46
问题 Is it possible to configure Converse.js to render it's boxes into custom div containers instead of adding them to the body of the page? 回答1: Yes, you can do this by writing a converse.js plugin in which you override the insertIntoPage method of ChatBoxView . Refer to the plugin documentation I linked to above. In short, it would look something like this: // The following line registers your plugin. converse_api.plugins.add('myplugin', { overrides: { // If you want to override some function or

In Python, how could I get a user input while simultaneously running the script?

不羁的心 提交于 2019-12-06 06:14:05
In my program I am trying to take the chat from a website and printing it on my console. While that's going on I'm using raw_input to get chat from whoever is using it. My problem is that raw_input pauses the rest of the script until i say something or press enter. Is there a simple way to fix this? You have to multithread. One thread for user input and another for the background tasks. The documentation is a bit complex (I'm pretty confused by it), but it's a start: http://docs.python.org/library/threading.html You may also want to look into the curses module: http://docs.python.org/library

PHP Comet. How to do it better?

拜拜、爱过 提交于 2019-12-06 06:09:48
问题 I have a simple comet chat. JavaScript send ajax request with long polling. When server find new messages in the database, it answers and gives JSON. Next, JavaScript send the request again. Javascript: function cometConnect(){ $.ajax({ cache:false, type:"get", data:'ts='+ts, url: urlBack, async: true, success: function (arr1) { //work with JSON //..... }, complete:function(){ cometConnect(true); nerr=false; }, dataType: "text" }); } PHP $flag=true; $lastmodif = isset($_GET['ts']) ? $_GET['ts

file() [function.file]: php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution

谁说胖子不能爱 提交于 2019-12-06 06:00:56
问题 I got the following error when I get contents from file("http://www.otherdomain.com"). file() [function.file]: php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution The domain server is linux. How to resolve this problem? 回答1: Quoting: If you're having problems with fopen("url...") but you can run 'host url' in a shell window and get the correct lookup, here's why... This has had me banging my head against it all day - finally I found the answer buried in the bug

get server response without using setinterval for chat applicaton php jquery

冷暖自知 提交于 2019-12-06 05:44:25
问题 i made a chat application, here is the refresh code setInterval(function() { $('#DisplauDiv').load('show-chat.php?session=<?php echo $_GET['session'];?>'); }, 1000); And this keep loading in each second, that will slow down the perfomance of my Mysql. While i cheeked Facebook(firebug), they dont have anything like this to get response from server. Please tell me the technique to do this. Thanks in advance to all for reading and replaying this.. 回答1: well setInterval is poor man's comit have a

Make c++ not wait for user input

大憨熊 提交于 2019-12-06 05:08:59
So, i am trying to make a c++ WinSock2 chatter, just for learning. It is a console application and i want to take user input (for sending to the counterpart), but i still want to be able to recive. (so you can write a message while still being able to recive one)... When using cin >> input; the program "pauses" until the user has enterd something, that way it is "turn based" (one user writes something and sends it, then the other user writes something and sends it). Is there a way to make the user be able to write something WHILE the recive stuff is still running? (Preferably something else