w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
how to use client chat on different pc
If you are launching your client by running the ClientTest class then you need to update it to use the server IP. In your current ClientTest code you are connecting to the server using the localhost IP: charlie = new Client("127.0.0.1"); Update it to use the server IP: charlie = new Client("use server IP"); server IP is the IP address of the machine where you are running your Server class.

Categories : Java

P2P chat client for android
You can't use private addresses since they are not routed on public internet, so you need to use public IP. Finding the real IP address is maybe not so difficult since the request to your server will come from that public IP. The real challenge is how to mitigate problems that PAT (NAT) creates. You can try with IGD protocol (UPnP) to do automatically configure port mapping but not every router supports it. Also you can use UPnP to get the public IP as well.

Categories : Android

Client/Server WCF Chat
wsDualHttpBinding requires the client to establish an address that the service can connect to in order to provide callbacks. This is done in the config file in the binding element, like this: <wsDualHttpBinding name="NewBinding0" clientBaseAddress="http://machine_name:port/Client/"> Since the client is on a different machine than the service, you'll need to specify the client's machine name. See WSDualHttpBinding Class for more information on this binding.

Categories : C#

A chat client using the Android NDK in c++
I do not know your level, but I assume that you are not feeling comfortable using C++, the I am sure that Poco can help you: http://pocoproject.org/slides/200-Network.pdf

Categories : C++

Socket chat client error
from socket import * You've imported the entire socket module. There is no socket.socket. You've imported the socket object directly into the current namespace. To access it, simple do s = socket((socket.AF_INET, socket.SOCK_STREAM)) If you had done import socket Then you could access the socket object via the module namespace.

Categories : Python

Lync Server chat client API for ASP.NET MVC
No, the Lync Client SDK isn't for websites. There are Silverlight controls available, but they will only work if the user has the Lync Client installed, which is probably not true for your website. For text only chat, you could look at UCWA, but you'd have to handle file-sending yourself. There's currently nothing that can do voice in a browser, but UCJA/jLync was announced at the Lync Conference 2014 Keynote and should be able to do that. I actually blogged about the different APIs available and what they are all for yesterday: http://blog.thoughtstuff.co.uk/2014/07/lync-development-picking-the-right-api/

Categories : C#

how to implement multiple client-server chat
Applying multithreading is a good solution, but when I applied, there gets connection extablished between only one client and one server.. Please help me to do this I did not get through (and thus checked) all your code, but I noticed one thing: in your startrunning() function you: create a server socket in an infine loop: wait for a new connection when there's a new connection call setupstream() and chat using whilechatting() so there, you will get only one new connection that will get its stream set up and chat. You can only have one thread serving your clients, so only the first one arrived will get served, until it releases the thread so another can connect. You should instead do: create a server socket in an infine loop: wait for a new connection when there's a new con

Categories : Java

C# Multi-Client socket Chat Application
Take a look at ZeroMQ. It was designed for applications like you're describing, works very well, and is free.

Categories : C#

Stuck with Multi-Client Chat Application
Your code looks like it could be improved quite a bit. Your main method for instance should have none of that code in it. It should start your Server class, and that's it (and note that class names should begin with an upper case letter as per Java standards which I strongly advise you to follow). I'm trying to make a MultiClient Chat Application in which a Server does nothing but listen and create connections. The Server is going to have to do more than that. It will need to create Clients, it will need to maintain a collection such as an ArrayList of Clients such as an ArrayList<ChatappClient> Otherwise how do you expect the Server to connect two Clients together? I think that in all you're going to need to think the structure and connections of this program out in more de

Categories : Java

Passing data from a class to a forms listbox | Chat-Client
Reason: You are getting cross thread exception because you are creating GUI on one thread and accessing it on another thread. This is not permissible in c#. You need to change your line like this MethodInvoker method = delegate { MessageBox.Show(sRecieved); }; if (InvokeRequired) BeginInvoke(method); else method.Invoke();

Categories : C#

iOS. Best way to pull data from a server (dynamic intervals) for HTTP chat client?
Don't use performSelector afterDelay. Using NSTimer is much better (as the trigger for starting the next download). Also, use NSOperationQueue to manage your background tasks. Create yourself a custom NSOperation that you can instantiate and it will complete your request process. When you create a new operation to check for new messages, check if one is already in progress (there is no point having multiple requests in progress at the same time). Other notes: Make sure you consider the threading with regards to the Core Data store (having the operation call back to the main thread with the results will probably be easiest as the result data will always be relatively small). If you have lots of messages being sent and you want to show constant status (like Skype does, showing you when so

Categories : Iphone

Handling multiple different requests and responses in client-server Chat Program
To make things more scalable, your application could benefit from using multiple threads on both client side and the server side. Be sure to use locks when handling common data. First, the client side could certainly benefit from using three threads. The first thread can listen for input from server (the recvfrom() call). The second thread can listen for input from the user and put these messages in a queue. The third thread can process messages from the queue and call socket.send() to send those messages to the server. Since the server is handling multiple clients, it could also benefit from having threads to listen for messages from the client and to process them. Once again, you could use one thread to get messages from the client and then queue them. You can use second thread to proc

Categories : Networking

Adding private chat functionality to simple twisted chat server
Actually I figured it out by changing the for loop in handle_CHAT. As I want the program to send the message to the specific user, a "talkwith" string can be added to the class and this string can hold that specific user's name. Then this change turns the program from public to private chatting. msg = "<%s> %s" % (self.name,msg) for name,protocol in self.users.iteritems(): if name == self.talkwith: protocol.sendLine(msg)

Categories : Python

For Chat window.whether i go for dynamic user control or client side div tag pop up window?
I helped write and maintain a simple chat window in ASP.Net WebForms a while back, the way we did it was to use some simple JavaScript making some HTTP requests to a page which had WebMethods on it. The C# page contained a WebMethod for getting new messages from the server which was called from JavaScript running on a setTimeout loop. It also contained a WebMethod for adding new messages to the session. If I recall correctly, some kind of queue was used per user involved in the chat session and all the method for getting new messages did was to map the user to the correct queue and take all the messages that were present at the time. Hopefully this helps.

Categories : Asp Net

Swing chat window creates extra chat windows
Just remove the static keyword from private static UDPCS1 chat = new UDPCS1(); and no more chat windows will be there... Hoping it helped... Helped in my case i was doing something too,...

Categories : Java

Chat client - Socket and server socket concurrently
ServerSocket blocks and that's it. But if you only want peer-to-peer communication between two connected parties and nothing more then this behavior is not a problem. You just need two programs: server and client. Server block until it gets connection from client and client blocks until it gets connection. If you want to implement Java IO in single thread you should use Java Nio. There are lots of tutorials for that in internet. For example http://tutorials.jenkov.com/java-nio/server-socket-channel.html. Also it seems that you are not very familar with networking and sockets so it might be beneficial to use some layer instead of raw sockets. Maybe you should consider JeroMQ (https://github.com/zeromq/jeromq) for implementing communication between programs.

Categories : Java

PHP AJAX chat - Chat commands logic?
You need to define a syntax for your commands yourself. For example /ban <username> for a ban. First you check whether the message begins with a slash. If so it is a command. Now search for the first space, everything after the slash and in front of the space is the command name. Pass everything after the first space to the command. In this case the username. The command handles the parameters on it's own. It could look like this: $message = '/ban TimWolla'; if (substr($message, 0, 1) === '/') { // $message is a command $firstSpace = strpos($message, ' '); $command = substr($message, 1, $firstSpace); $parameters = substr($message, $firstSpace + 1); if (!hasPermission($command)) error('Permission denied'); switch ($command) { case 'ban':

Categories : PHP

which is faster, saving chat history in a text file and display it or using mysql db to save chat history
For a real-world implementation, I wouldn't consider either one of these a good option, but it definitely could be fun to play with. Using files isn't going to scale as well as the db,well... as easily. But really, I'd look into just setting up a jabber server and play with that. Or maybe look into node.js.

Categories : PHP

Pop up chat box on new chat message
Web sockets tends to be the way to go for chat applications, in your case it sounds like server sent events could be perfect (as from what it sounds you're only receiving events, for two way communication you'll be good using web sockets), both lack support in older browser. So if you need to support older browsers you can go with long polling which out of your choices has the least load on the server as it's one request for every response. See this post: What are Long-Polling, Websockets, Server-Sent Events (SSE) and Comet? for more info on the specific technologies

Categories : PHP

Client A change source mac address to Client B when send packet, But Client B's module can not rx packet after server sent
Probably because your switch has seen client B's MAC address on the port to client A and has remembered that. It will therefore send the reply on the ethernet port to client A, not to client B's erhernet port. This seems to be a networking issue, not a programming issue. Therefore this question might be more appropriate on a different forum.

Categories : Linux

Weird blinking on the lock screen remote control client when stopping it from the client itself
Ok I fixed it. It's simply because the RemoteControlClient cannot be playing when we abandon audio focus. So I just had to call that before destroying anything: remoteControlClientCompat.setPlaybackState(RemoteControlClient.PLAYSTATE_PAUSED);

Categories : Android

ZeroMQ, Client<-> Server , bi-directional communication possible with only having the client connect to host?
For connecting to the server, you need a DEALER socket on the client side, and a ROUTER socket on the server. Because you need a publish subscribe pattern you will need a SUB socket on the client side, and a PUB socket on the server side. Client Server +-------+ +--------+ | Dealer| <--> | Router | | Sub | <-- | Pub | +-------+ +--------+ So you bind the Router and the Pub sockets, and connect the Dealer, and the Sub sockets. Than when you want to: Publish Messages (no reply expected): Create an envelope ( pub, channel, message ) and send it through the Dealer, on the Router side the router will receive the following envelope ( dealer, pub, channel, message ), so you can publish the message on channel through PUB socket. Receive Messages (no reply exp

Categories : C#

What are some methods of initializing server-client connections to an android client device?
Google Cloud Messaging GCM. It's free. It's unlimited. It's maintained by Google. And it's already installed on user's phones. That being said, the ideal way now is to use Google Play Services and have people login with their Google+ accounts. Watch the last Google I/O 2013 session on Google Play Services. The demo went wrong during the general keynote, but it works fine otherwise. Google Play Services takes care of all the networking issues for you (and also falls back to local wifi if users are on the same network). The price you have to pay is that you must force your users to use Google+ if they want that multiplayer functionality.

Categories : Android

twisted , return custom message to client after receiving request from client
You code appears to already do what you are asking. Simple.render_GET returns response. response is what is sent to the client. Perhaps you're unsure how to get the response after it has been sent to the client? If so, the answer may be readBody (more docs).

Categories : Python

Website access per client and each client having multiple users Sample Application
of course you can have every sub-application it's own ASP.NET membership. or if you want the work out-of-the box solution for cms, you can try dotnetnuke community version and set the sub-website it's own settings

Categories : C#

Trying to make udp server echo back to udp client and print on the screen, as well have udp client receive messages
(If you read my earlier answer, please ignore it. It was incorrect.) You missed a '&' in front of addrlen on line 82 in udpserver.c. It should be: size = recvfrom(sock, buffer, nbytes, flags, (struct sockaddr *)&from, &addrlen); Other than that your code is working fine (I ran it). However, there are three things I would like to mention: The client does not need to to bind his socket to receive messages from the server. The server does not need to create a new socket to send messages to the client. Just use the socket you called recvfrom with. Sockets should be closed once they are not used anymore (even at the end of the program). Having too many open sockets will lead to not being able to create any new socket.

Categories : C

Where the data was put in wpf client app with client/server model with mvvm light?
This really depends on the size of your project. If I write a small MVVM application (with a single project), then I create the following folders: Converters (if required) DataTypes - some developers put this into 'Models' also, but I prefer to separate them Models - I use this for data access classes <<< put your class in here <<< Utilities - some developers call this 'Services' ViewModels Views If the application is large, then I create separate projects with these names instead and add a few others as well.

Categories : Wpf

OpenSSL client verification - Need client side validation requirements
Just an FYI, Another way to solve this problem may be to run your C program under sslclient, which basically works similar to DJB's tcpclient, but with SSL - i.e. sslclient will spawn your program and open an SSL connection to the server, and pipe your program's stdout to the server, and pipe output from the server to your program's stdin. The nice thing about doing it this way is that you can let sslclient to all the heavy lifting as far as negotiating SSL protocols with the server and doing the actual encryption, and you can focus on the core function of your program. See http://www.superscript.com/ucspi-ssl/sslclient.html for more info.

Categories : C++

WCF Client for Axis2/Rampart Webservice using WS security without client certificate
This binding is the closest you could get with ootb wcf: <customBinding> <binding name="NewBinding0"> <textMessageEncoding messageVersion="Soap11" /> <security defaultAlgorithmSuite="Basic128Rsa15" authenticationMode="AnonymousForCertificate" includeTimestamp="false" messageProtectionOrder="EncryptBeforeSign"> <secureConversationBootstrap /> </security> <httpTransport /> </binding> </customBinding> It produces a very similar XML with one different: It also adds a digital signature. There is no way to directly tell WCF not to add a signature. Most chances are this will not be a problem for you

Categories : Wcf

Prevent XSS in chat
Don't guess, use a function made for the job: HTTPUtility.HTMLEncode Instead of removing "unsafe" strings, encode any character that might be parsed as HTML into an HTML Entity. If this isn't a web-app, the similar functions can be found in WebUtility.

Categories : C#

Client Socket Connections Being Denied By Server on Windows Host For Small Number (16 < x < 24) of Simulataneous Client Connection Attempts
I would check how many connections are in the TIME_WAIT state of the TCP connection. I have seen this type of problem due to many connections being open/closed causing socket exhaustion due to the TIME_WAIT. To check it, run: netstat -a

Categories : Java

Node.JS Client App Simulating 1000/+ Client Connections
From the doc net.createConnection(options, [connectionListener])# Constructs a new socket object and opens the socket to the given location. When the socket is established, the 'connect' event will be emitted. For TCP sockets, options argument should be an object which specifies: port: Port the client should connect to (Required). host: Host the client should connect to. Defaults to 'localhost'. localAddress: Local interface to bind to for network connections. For UNIX domain sockets, options argument should be an object which specifies: path: Path the client should connect to (Required). I guess connx[connNos] = net.createConnection(PORT,HOST); should be connx[connNos] = net.createConnection({port:PORT,host: HOST});

Categories : Javascript

Can you let a proxy between Client and Server change the Client´s Ip Adress
Well, it depends on how you are connecting to the server. Is it just a plain socket? If so, it will be hard, at least via normal Socket API, at the end the Proxy is who is connecting to the server... IF you are accepting http requests, then, depending on the proxy server, you will probably get a header X-Forwarded-For which will have the real IP Address that connected to the proxy.

Categories : Java

How do Jersey-client and Apache HTTP Client compare?
These two things probably should not be compared directly. Jersey is a REST-client, featuring full JAX-RS implementation, neat fluent API and a powerfull filter stack. Apache Http Client is a HTTP-client, perfect in managing low-level details like timeouts, complex proxy routes and connection polling. They act on a different levels of your protocol stack. When you're using Jersey there is always some kind of HTTP client backend involved. Given no backend explicitly, Jersey will use HttpUrlConnection as a default backend. Jersey with HttpUrlConnection backend example: Client client = Client.create(); WebResource webResource = client.resource("http://localhost:8080/path"); ClientResponse response = webResource.accept("application/json") .get(ClientRespo

Categories : Java

In client side MVC, who should handle client-server communication?
The model layer should be interacting with data source. In case of client-server setup where you have two separate and independent triads, the data source for client's model layer would be server's presentation layer. Basically, your client-side's model layer becomes the user of server-side.

Categories : Web Services

Chat clients in Windows
Is your chat client a Peer 2 Peer model? In other words, do the clients connect directly to each other? If so, then they will need to know the IP/hostname of the other peers, or they will need to provide a way to publish their connection info. Going with that second method, you are close to establishing a client-server model. In this case, the server keeps track of the client sessions and routes the messages. The "big guys" use a client-server model, so it's close to option #1 in your question.

Categories : C#

Chat App using Socket.io and Node.js
This doesn't seem to be a nodejs-issue. You have a server that should be reachable by IP with something like 'http://your.domain.or.ip:80'. If you get a "can't connect" in your browser then make sure there is no firewall in its way and that port (in the example: 80) is reachable from your browser location (aka known as "your pc"). Please note that you have your socket-service on port 8001 and your web server maybe runs on a different port? Make sure both ports are open. If you get a blank page, check the browser javascript error messages. There is a chance that you forgot to upload the file 'socket.io.js' in that directory '/socket.io/'. Try to download that file directly to see if your server serves.

Categories : Node Js

signalR chat with db mvc4
You will have to save the user id and the connection id to your database as well as saving the messages that are sent in that chat. When you load the users inbox, you can load their past chats from the database with their chat id and the user they were chatting with. When they click on one of them you can load their chat history using the chat id and/or user id doing something like this (haven't tested, just a mock up): public override System.Threading.Tasks.Task OnConnected() { string chatID = Context.ConnectionId; string history = GetHistory(chatID); Clients.Caller.chatHistory(history); //you'll need to create a chatHistory handler on the client side. } private string GetHistory(string chatID) { return dbcontext.GetChatHistory(chatID); }

Categories : Database

Comment like Facebook in iOS chat
Well you can try one of these controls .... hope they help you .. https://github.com/brutella/chatheads https://github.com/kenshin03/Home-For-iOS

Categories : IOS

Bubble Chat layout
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/background" android:layout_width="wrap_content" android:layout_height="fill_parent" <!-- android:layout_gravity="left" --> android:orientation="horizontal"> <ImageView android:id="@+id/avatar" android:layout_width="32dip" android:layout_height="32dip" android:layout_marginRight="4dip" android:src="@drawable/controller" /> <TextView android:id="@+id/text" android:text="asd" android:textColor="#FFFFFF" android:

Categories : Android



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.