w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Client-Server Program: Client can connect to server easily but server can't respond cause target machine actively refuses connections
You need to design your client and server so that the client-to-server connection remains open to recieve the responce and then do something like this: public static bool sendTo(IPEndPoint ip, String data) { TcpClient client = null; NetworkStream stream = null; StreamWriter writer = null; StreamReader reader = null; try { client = new TcpClient(); client.Connect(ip); stream = c.GetStream(); writer = new StreamWriter(stream); writer.WriteLine(data); writer.Flush(); reader = new StreamReader(stream); string response = reader.ReadLine(); if (response == "roger-alpha-tango") { return true; } } catch { return false; } finally { i

Categories : C#

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#

SMTP client returning "unable to connect to remote server" - Amazon SES server
There were three issues at hand: 1: The email address it was being sent from was not verified with Amazon, and neither was the recipient (verification of recipient only needed in sandbox mode) 2: The out port I was using, 587, is blocked by my company, which seems to be common practice 3: Using async can only be done when you specify the page uses async in the aspx "header"

Categories : Amazon

can't connect to the database server from the client
The default installation of SQL Server Express is to allow only local connection. See this: http://technet.microsoft.com/en-us/library/ms165718(v=sql.105).aspx

Categories : C#

Connect to ssl server using java client
You basically have to create an SSLSocketFactory see here for an example. Once you've created the SSLSocketFactory you can set it when you create a Connection from the URL like so. SSLSocketFactory sf = ... see that example URL url = new URL("https://google.com"); HttpsURLConnection connection = (HttpsURLConnection) url.openConnection(); connection.setSSLSocketFactory(sf); ... Now do stuff with that connection like GET or POST Also fyi, you are going to want to convert your certificates into the JKS format that Java prefers in order to easily load them into the SSLSocketFactory. You can use a program called keytool that comes with java which can help you out.

Categories : Java

It's possible signalR client web to connect a server on a different PC?
Are you not able to run IIS on your machine? See the following tutorial on how to set up a SignalR application: http://www.asp.net/signalr/overview/getting-started/tutorial-getting-started-with-signalr

Categories : C#

Connect android client to be C# server
see this fix . for out.println(message); out.flush(); C# read should be socket = listeningSocket.Accept(); using (NetworkStream nt = new NetworkStream(socket)) { using (StreamReader reader = new StreamReader(nt)) { string line; string line; // while ((line = reader.ReadLine()) != null)//as networkstream never got eof. was using it as replacement while(true) // { while (true) { try { line = reader.ReadLine();

Categories : C#

How can I connect a C# SSLStream client to an OpenSSL server?
Ok, got it. In fact, I was setting up the BIO and the SSL variables in the wrong order. You have to create and attach your BIO to your SSL BEFORE you actually call SSL_Accept in OpenSSL, otherwise the authentication cannot complete, which seems logical. Also, I was using SSLStream in C# on client side to send my messages, while I was using BIO_read and BIO_write on the server Side with OpenSSL. This could not work, because BIO_read and BIO_write are no equivalent to SSL_read and SSL_write. These two functions only read and write on the underlying socket, without any encryption or decryption, making the SSL handshake almost useless (aside from checking the identity of the other end of the line). This explains why I was not able to engage communication as the two ends did not speak the s

Categories : C#

Example for Client socket that try to connect to the server for 2 seconds
Instead of having two separate python files, you can have a single file but put the server and client in separate threads. sys.stdout.write is used instead of print due some concurrency issue with print being buffered (it mixes strings). import threading import socket import sys class socket_server(threading.Thread): TCP_IP = "127.0.0.1" TCP_PORT = 7777 BUFFER_SIZE = 20 daemon = True def run(self): s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.bind((self.TCP_IP, self.TCP_PORT)) s.listen(1) conn, addr = s.accept() (ip, port) = addr sys.stdout.write("%s connection address: IP %s on Port %d " % (self.__class__.__name__, ip, port)) data = True while data: data = conn.recv(self.BUFFE

Categories : Python

Connect to Hive server using SquirrelSQL client
Follow the instructions on link Hive JDBC Interface on section "Integration with SQuirrel SQL Client", Its working for me after import jar files to SQuirrel/lib folder..

Categories : Hadoop

how connect to sql server developer from a client system?
The steps in this blog post may help: http://blogs.msdn.com/b/walzenbach/archive/2010/04/14/how-to-enable-remote-connections-in-sql-server-2008.aspx

Categories : Sql Server

How to define how much seconds Client socket try to connect to the server?
You could make the socket non-blocking, and then wait with a timeout with select for the socket to become writable. When select says the socket it writable, you are connected. As for the actual internal timeouts in the IP-stack, at least on Windows they didn't use to be configurable. If there was problem connecting then it would take about 45 seconds for all retries to time out.

Categories : Python

Does TCP client need open ports to connect to external server?
As long as your GSM operator allows outbound traffic, you need no ports open to connect to a remote server. When you try to establish a connection, the provider's NAT or NAT-like equipment will open a port temporarily for that one socket. It allows for outbound without letting inbound packets open connections. If your GSM provider disallows all traffic, you're out of luck.

Categories : Java

Client can connect to Server on same machine using localhost, but not when IP Address or hostname is used
Usually when you set up a server, you need to specify the hostname or IP the server listens on. When you initialize a server to use localhost, you can only use localhost to connect to it. If you want a server to accept requests from every source you need to see if you can use a wildcard to accept all connections. For example 0.0.0.0 is used a lot.

Categories : C#

How do I run Ubuntu Server headless using Parallels Desktop?
Make sure Parallels Desktop is not running. If it is running, the commands below will still create a console window. From Terminal.app, use the Parallels command line: prlctl # List available VMs prlctl list --all # Start a VM using its name prlctl start UbuntuServer # Stop the VM prlctl stop UbuntuServer # Pause and Resume prlctl pause UbuntuServer prlctl resume UbuntuServer # Reset and Restart prlctl reset UbuntuServer prlctl restart UbuntuServer

Categories : Osx

Headless browser without server installation for multithreads application
You can use PhantomJS which is a headless browser and connect to it with Selenium WebDriver (how?). PhantomJS is based on Webkit so it has fast and native support for latest web standards. Although for .Net guys it might be easier to use SimpleBrowser which is fully implemented using C#, i have no idea about the performance and support of standards.

Categories : Dotnet

Running Flash Player on Headless Linux Server
Try this xvfb-run +extension RANDR ./flashplayerdebugger screenapp.swf Also, I found that its very useful that in Linux you can just copy-paste any console error or message by ctrl+shift+c (various for different consoles) and just google about it possible solutions.

Categories : Linux

can not connect to XMPP server (Openfire) using XMPP android client
Found temporary solution :).. I put the connection part of the code in AsyncTask (http://developer.android.com/reference/android/os/AsyncTask.html). Now it works fine but I did other stuffs also, I used the smack API library from another project on the web that is already working.. So Im still searching for smack api that works with my project. I have seen http://asmack.org.. but didn't work for me!!

Categories : Android

connect server-side computing with client-side visualization
First of all, I would suggest JSON rather than XML to be used for exchange format, it is much easier to parse JSON at the javascript side. Then, speaking about the architecture of your app, I think that it is better to write a server web application in Python to generate JSON content on the fly than to modify and serve static files (at least that is how such things are done usually). So, that gives us three components of your system: A client app (javascript). A web application (it does not matter what framework or library you prefer: django, gevent, even Twisted will work fine, as well as some others). What it should do is, firstly, giving the state of the points to the client app when it requests, and, secondly, accepting updates of the points' state from the next app and storing the

Categories : Javascript

how do i disable javascript while running headless selenium server and using firefox?
in case of PhantomJs Headless Tesing you can do it like this public static void main(String[] argv) { // prepare capabilities Capabilities caps = new DesiredCapabilities(); ((DesiredCapabilities) caps).setJavascriptEnabled(false);//by default it was enabled ((DesiredCapabilities) caps).setCapability( PhantomJSDriverService.PHANTOMJS_EXECUTABLE_PATH_PROPERTY, "E:\browsers\phantomjs-1.8.2-windows\phantomjs.exe" ); WebDriver driver = new PhantomJSDriver(caps); driver.get("https://www.google.com"); } if you want to disable javascript in firefox programtically in selenium you can do it by creating profile FirefoxProfile profile = new FirefoxProfile(); profile .SetPreference("javascript.enabled", false); driver = new FirefoxDriver(profile );

Categories : PHP

Client - Server program: send string from client to server and received respond
As the server, just write back into the very same NetworkStream you read the string from! On the client side - nothing different - read freom the NetworkStream you just wrote the string to. Your NetworkStream objects should simply work in both directions ;)

Categories : C#

Twilio Client Conference Call Monitor incomplete output with PHP error
The support team at Twilio advised the following: ...it looks like there's a bug in the example code. Can you change this: $conferences = $client->account->conferences->getPage(0, 50, array('Status' => 'in-progress')); to: $conferences = $client->account->conferences->getIterator(0, 50, array('Status' => 'in-progress')); i.e. change "getPage" to "getIterator" ? This corrected the error I reported, but introduced other issues not within the scope of this question.

Categories : PHP

I can connect to the database via SQL Server 2008, but can't connect via Node.js
Sadly, SQL Server and MySQL doesn't share anything but the SQL and some syntax. The protocol of the connection aren't the same. So the node-mysql package won't work for you. You can find the SQL Server driver on this MSND page with the explication on how to use it or directly on the GitHub page of the project.

Categories : Mysql

This version of Microsoft SQL Server Management Studio Express can only be used to connect to SQL Server 2000 and SQL Server 2005 servers
I just ran in to this issue as well but then was able to find the solution. You just need the newer version of SSMSE which is now 2008! Here's the MS download page: http://www.microsoft.com/en-us/download/details.aspx?id=7593

Categories : Misc

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

send image from server to client and from client to server
read() on a socket stream will return -1 only if connection is closed or an error occurs. Server receives the data and saves it but never leaves the receiver loop to send data. Even if it would do the client wouldn't then leave its receiver loop either. You must either close the connection or send file size before the actual file and receiving stops when given size was read.

Categories : Android

Client/Server Application That Can Deploy Client From Server
I have built an application which does exactly what you require, and the solution is fairly straitforward if not necessarily easy. Firstly, the client runs a specialised client proxy (seperate assembly running as it's own process)with a thin fixed interface and the server runs a specialised server proxy with a thin fixed interface. On client init', the client passes assembly and configuration (file and registry, etc.) version info in a composite value object through the Client proxy. Server checks info' and if required returns a url for a packaged archive if an update is required. The client proxy downloads the archive (which consists of a script, assemblies, resources and config), shut's down the main client, executes the script which contains installation instructions, and then restart

Categories : C#

How can I monitor ASP.NET MVC server load and performance without access to IIS log files
You should probably take a look at the New Relic add-on. AppHarbor has a bunch of other monitoring add-ons that might work for your use. Hosted Graphite is another one.

Categories : Asp Net

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

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

What tool can help me identify various performance metrics pertaining to a server & also monitor them?
A tool will not solve your issues. As to being a performance tester or a performance engineer the tool is 5-12% of the job. The rest of the job is interwoven with your foundation skills in communications, development, architecture, project management, systems analysis, etc... What you have expressed here would speak to weaknesses in application architecture and systems analysis. You need to understand what to monitor to discover system bottlenecks before you can ask a tool to monitor this information on your behalf. I would turn you to several references by Andrew Tanenbaum, "Modern Operating Systems" and "Distributed Systems: Principles and Paradigms." Keep in mind that JAVA Virtual Machines, .Net Virtual Machines and Databases function as guest operating systems so the princip

Categories : Performance

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

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

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 you monitor a file on a web server and log every access, ideally by IP address, in a database (MySQL)?
The Apache HTTP Server provides logging capabilities. The server access log records all requests processed by the server. The location and content of the access log are controlled by the CustomLog directive. The LogFormat directive can be used to simplify the selection of the contents of the logs. This section describes how to configure the server to record information in the access log. It can be used to write the log to a file. If you need to store in a MySQL table, run a cron job to import the file into the database. Further information on logs is here: http://httpd.apache.org/docs/1.3/logs.html#accesslog

Categories : PHP

Using Performance Monitor to monitor pooled connections
You can run this from a SQL query windows to get a count and the details of current connections and session running on your SQL server. select * FROM sys.dm_exec_sessions AS es INNER JOIN sys.dm_exec_connections AS ec ON es.session_id = ec.session_id I've had trouble with pooled connections. They're hard to control. Explicitly closing them never seemed to work since they're under the control of .NET. The biggest reason we've run out of connections is uncommitted transactions. If a transaction is left uncommitted or rolled back for some reason, the connection, instead of being re-used, get's stuck in limbo, forcing .NET to open yet another connection to continue processing.

Categories : Sql Server

`connect': Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) (Mysql2::Error)
Find your socket file using mysqladmin variables | grep socket And then add the socket file to your database.yml configuration development: adapter: mysql2 host: localhost username: root password: xxxx database: xxxx socket: <socket location>

Categories : Mysql

Mysql-client cannot connect new ip
this may be a DNS cache issue. Try flushing your cache. If you are on windows/osx, look at this: http://docs.cpanel.net/twiki/bin/view/AllDocumentation/ClearingBrowserCache I'm not sure what has to be done on Linux. (Flush on CLIENT side, by the way).

Categories : Mysql

XDebug could not connect to client
Xdebug's default port (9000) conflicts with FastCGI (Xdebug was first!) - the solution is to change it to another port. After having done that, you need to restart your IDE where you will also need to configure the new port. You will also need to restart PHP and your Web Server.

Categories : PHP



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