w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Client isn't connecting to server
Always create output output stream before your input stream for Object streams, otherwise you create a deadlock situation. output = new ObjectOutputStream(socket.getOutputStream()); // output.flush(); if the underlying stream is buffered input = new ObjectInputStream(socket.getInputStream()); The input reads the header written by the output, which won't be there unless the output is created first.

Categories : Java

Connecting to a remote machine through client-server
You say the other machine has an external ip address. This implies it also has a local ip address; ie it is behind a NAT firewall or similar. In this case, you will have to configure the firewall to allow communication to take place, eg by setting up port forwarding. Applications such as MSN Messenger, VOIP clients etc have elaborate mechanisms to negotiate this automatically, but they're often not very successful.

Categories : Vb.Net

Python - connecting sockets, client/server agnostic
Here's a rather crude class that actually works to some extent, which might get you started. The main trick here is not to bother with listen at all: these are pure peer to peer connections, fully specified by the <local-addr, remote-addr> pair. Note that the sockets are left in non-blocking mode. I caught the recv exception but there can be a send one as well (plus, you get broken-pipe errors when sending to a dead peer, etc). You'll also need to handle EOF-from-terminated-peer (when recv returns '' instead of failing with EAGAIN). import errno import os import select import socket class Peer(object): def __init__(self, local_addr, peer_addr): self._local_addr = local_addr self._peer_addr = peer_addr self._renew() self.reopen() def _ren

Categories : Python

Java client connecting to PHP server for MySQL database with authentication
Create a PHP file that accepts POST. In your JAVA, try passing a custom header KEY:VALUE pair that's verified via your PHP file - or try to think of a more elaborate way. Then, post along the username and password to the PHP file: POST http://server.com/java-auth.php?user=username&pass=password for pseudo example. Then, have that PHP file return a JSON-encoded string or a serialized string... or go super fancy, and encrypt it all with public/private keys. Hope this helps :)

Categories : Java

sqlsrv error while connecting to mssql server 2008 on windows 2003 server
Two ways to try, first to check if the Native driver has the right version - is your server really a 32bit Version and not 84bit? The other thing is, to check if the extensions are actually loaded. To check that, create a file like "phpinfo.php" and put it in you folder for .htdocs. <?php // show phpinfo file phpinfo(); ?> The easy way is to search for it in the phpinfo-Page with Ctrl+F and "extension=php_sqlsrv_53_ts_vc9.dll"

Categories : PHP

Getting an error when connecting from android to PHP server
There are issues with your PHP. You are not passing back any JSON. You will need to change your script to encode your array into JSON. $result = json_encode($json) Returning the actual JSON will help. Make sure you are not returning any HTML either. Your Java is trying to parse a JSON response, but you are responding with <!DOCTYPE...

Categories : Java

Error connecting to server in a file
This line: inet_aton(h->h_addr_list[0],&indirizzo_server); is wrong. h_addr_list is not a list of strings in the format that inet_aton expects. It's not even a list of strings at all. It's a list of addresses ready to be copied directly into the appropriate field of the struct sockaddr_*. The char **h_addr_list in struct hostent should be treated as void **, which is what it would be if it hadn't been designed before ANSI C gave us void. A generic pointer is used because gethostby* supports (at least theoretically) arbitrary address families. In the case of h_addrtype==AF_INET, each h_addr_list[n] is a pointer to a struct in_addr, so you can just say indirizzo_server = *(struct in_addr *)h_addr_list[0]; and all will be well.

Categories : C

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#

"Illegal characters in path" error when connecting to SQL Server
You'll need to escape argil3.mdf Use \ or put an @ before the assignment of the string, for instance. SqlConnection Con = new SqlConnection(@"Data Source=.SQLEXPRESS;AttachDbFilename=|DataDirectory| argil3.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True");

Categories : C#

secure auth error connecting to SQL server from RMySQL
You may have an old my.cnf configuration on your local machine. You can override the client option secure_auth in my.cnf or in a specific config file you pass to dbConnect() dbConnect(MySQL(), default.file="your-file.cnf" The info on the setting is here: https://dev.mysql.com/doc/refman/5.6/en/mysql-command-options.html#option_mysql_secure-auth As an aside, you should really not be using 4.1-style password hashing :)

Categories : Mysql

Database not found error when connecting to Derby network server
By the JDBC url, it's looks like you're trying to connect to a Derby server vs. an embedded instance. If you are trying to connect to a server instance, here are some considerations: did you start the server yourself, did mydb already exists? if not, did you pass in the correct params to create (e.g. ;create=true) example: jdbc:derby://localhost:1527/dbname;create=true if mydb did exists, are you pointing the server to the correct location? also, depending on what was used to start derby (e.g. embedded vs network driver) default database locations are different as well. You can read about it here Basically the exception you're getting is that Derby's saying it can't find your database - it's basically a path issue.

Categories : Java

I'm trying to edit a datatable on a SQL server and i keep getting an error about either not accepting a keyword or not connecting due to a timeout
The ConnectionString key in the connectionString section of your web.config is used for an SqlClient.SqlConnection but you specify to use providerName="System.Data.OleDb". You should change to providerName="System.Data.SqlClient" The OleDb client cannot understand that syntax. Then the UPDATE command uses 5 parameters, but you add only one to the Parameters collection. This will be another error, after the opening of the connection. Then in BindGridView you use a connectionstring not defined anywhere, finally the SELECT statement here refers to a table named GridView, I suspect that you have mistyped the correct name of the table (the one used in the update command is called DevTesting ) For the timeout problem you should add the exception message connected to the timeout

Categories : C#

netcat client doesn't exit with error when tcp server has error
TCP doesn't have any concept of the remote server "crashing". When a program with an open TCP socket ends (regardless of how), the OS will close the socket. In order to do what you want, you would need to create a protocol where the server would acknowledge completion of whatever operation you want it to perform and then the client would exit with failure unless it got that application-layer acknowledgement.

Categories : Node Js

Error consuming Web Service: SOAP-ENV:Client Internal Server Error SoapDoc::CheckNameSpace: Wrong xml name space
After hours of investigation, i solved it, the problem was the Soap version, by default, Zend uses Soap 1.2. When i changed it to the 1.1 version, everything works perfectly. $params = array( 'soapVersion' => SOAP_1_1 ); $client = new Zend_Soap_Client($url, $params); I hope help somebody with this :D Greetings

Categories : PHP

C# :Does Client machine need SQL Server installed on it while connecting to other machine having SQL Server installed on it (the Server machine)
The pieces needed to connect to SQL server are built into the .net framework. As long as you used those when coding the client piece you can connect to a SQL Database without MSSQL installed on the client. using System.Data; using System.Data.SqlClient; SqlClient PS: I am asking beforehand to avoid the last minute hassle on the day of installation. You should always test locally first. You can probally get your hands on a random test machine to verify that everything is good to go.

Categories : C#

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#

server error sent to client in express
You already have the answer in your question. You need error-handling middleware (app.use a function with an arity of 4) to handle the error. You just need to add the error-handling middleware after the router. Your example puts the the error handler above the the router. Either move the app.use(function (err, req, res, next)) to the bottom of your code or insert app.use(app.router); above the error handler. Refer to the documentation for more information about error handlers.

Categories : Node Js

What should a RESTful client do with its POST, PUT, or DELETE request upon a server error (500)
4xx errors are "something is wrong with the client, they're sending the wrong stuff". 5xx errors are "something is wrong with the server, sorry it's out sick today." Which basically means there's nothing the client can imply from a 5xx error. It could be permanent, it could be transient, the client doesn't know. IIS sends a 500 error because IT doesn't know what happened. If your app is blindly throwing exceptions up to the web tier, there's not much more it can do or say about it. If the server logic somehow actually KNOWS what's wrong, and WHEN it might be fixed, it can send a 503 error, telling the client it's unavailable and a Retry-After header telling the client when it will be back. As for a client behavior, it's sort of dependent on the clients history with the service. Maybe

Categories : Rest

How to test if an error occurred on the Server, and output client side
I have this simple solution for you... if(req.getParameter("report").equals("true")) { req.getSession().setAttrinute("REPORT_OK",false); //If the query string parameter is set, generate the PDF. if(!PdfReportGenerator.generateReport(res, repositoryURI)) { // Something went wrong, so redirect the browser. res.sendRedirect(req.getRequestURI()); }else{ req.getSession().setAttrinute("REPORT_OK",true); } } Now in your RequestURI page have a document.ready() function to check with ajax about the state of the REPORT_OK variable. Case 1: If the value is null that means that the request in not a callback from your code above, so you don't display anything to the user. Case 2: If the value is false, then that means than an error happened and you can inform the user about i

Categories : Java

Client-Server communication in REST, Spring (RestTemplate): getting 404 error
I guess you are using the wrong url to call the Web Service http://localhost:8081/SpringMVCMerchant/movieTheater.htm This ends with .htm whereas your RequestMapping does not contains this request pattern Update: Make sure there no console errors and also, if your server application is running on 8081.

Categories : Http

XAMPP Apache error: client denied by server configuration
Apache in Xampp will not start if there is another application using port 80. For example : Skype uses port 80. Therefore when Skype is running Apache will refuse to start since its working port is not available to be registered. You have mentioned that you tried to access the server from your parents website. How did you do that? Xampp do not allow non local ip's to access its apache server running on local machine / network. If you want this behavior to be changed, use "Allow All" and remove if any "Deny" parameter is specified in httpd.conf. Don't forget to save config file. Restart the Apache server to apply the new rule. Cheers..!!

Categories : PHP

Error 401 Google-api-php-client verifing by server Android inapppurchase
I think my problem was because I was trying to use Service Accounts with a Google Apps Gmail own account ( non @gmail.com account ). I had to delegate domain-wide authority to my service account. And I had to instantiate a Android Publisher Service as follows: ( only founded in Google Api Drive documentation ). I added "sub" parameter programmatically in Google_AssertionCredentials like follows: $auth = new Google_AssertionCredentials( SERVICE_ACCOUNT_NAME, 'https://www.googleapis.com/auth/androidpublisher', $key); $auth->sub = "myown@email.com"; $client->setAssertionCredentials($auth); The documentation in Google Play Android Developer API is very poor, and Google Support doesn't help, they redirects you to documentation. Google PHP developers even don't know how Service Accounts

Categories : Android

Passing server error message to client (using Express and Backbone)
Found a solution. Define a class variable and capture the return from the fetch call: private xhr: XMLHttpRequest = null; Then: public fetchObject(successF: Function, failF: Function): void { this.myObj = new MyObj(); this.xhr = this.myObj.fetch({ success: successF, error: failF }); } Finally: private failF(model, xhr, options): void { doSomething(this.xhr.responseText); } this.xhr will contain the reponseText (i.e. 'CUSTOM ERROR MESSAGE'). The local xhr will still be a blank string. I'm still not sure why this is the case, and if anyone has some insight I'd appreciate it.

Categories : Node Js

"Unhandled Error" comes when TCP server tries to accept connections from client in twisted
class ChatServer(Protocol): def connectionMade(self): print("A Client Has Connected") factory = Factory() reactor.listenTCP(80,factory) You haven't made any association between factory and ChatServer in this code. Try inserting this line: factory.protocol = ChatServer In an upcoming (not yet released) version of Twisted, Factory is getting a new class method to make this set-up even easier. Using that version, this example would be even shorter: class ChatServer(Protocol): def connectionMade(self): print("A Client Has Connected") reactor.listenTCP(80, Factory.forProtocol(ChatServer))

Categories : Python

Connecting datapower and worklight client side
You cannot make arbitrary requests outside of your domain from the client side using AJAX. See for example: Origin is not allowed by Access-Control-Allow-Origin

Categories : Ajax

Connecting to a Web Service using Client Certificate authentication
It appears that the server did not understand TLS. I had to specify SSLv3, via System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Ssl3;

Categories : C#

Connecting to HDP 2.0 (Hortonworks Hadoop) with yarn client
Current version of Hortonworks HDP 2.0 VM only works with libs taken from VM itself. Here is the description of what needs to be done: http://fusionworks.md/connecting-to-yarn-on-hortonworks-hdp-2-0/

Categories : Hadoop

HTTP 500 Internal Server Error when executing client javascript in any XPage
Thanks everybody for your help. Naveen's advice proved very useful. After checking "Display XPage runtime error" on Designer (Application -> Properties -> Tab XPages), the error message was much more meaningful: The generated page version 8.5 is not compatible with the server version 3.0, for the page /prueba.xsp. The problem is that my Notes Client and Designer are a higher (8.5.3) version than the Domino Server (8.5). According to this note: http://www-10.lotus.com/ldd/ddwiki.nsf/dx/XPagesPageVersions.htm, the eventHandler syntax has been changed slightly, and this causes the XPage to be marked as version 8.5.1. This also explains why it works when the database is local! I have tried the workaround suggested in the note (altering in the page source back the event handler

Categories : Javascript

The SMTP server requires a secure connection or the client was not authenticated - Error
I solved this problem by passing email with email user name in the following in the format User Name< example@domain.com > Sample from Amazon site is already working for me, here is my working code, AWSCredentials objAWSCredentials = new BasicAWSCredentials(AWSAccessKey, AWSSecretKey); Destination destination = new Destination().WithToAddresses(new List<string>() { TO }); // Create the subject and body of the message. Content subject = new Content().WithData(SUBJECT); Content textBody = new Content().WithData(BODY); Body body = new Body().WithHtml(textBody); //Body body = new Body().WithText(textBody); // Create a message with the specified subject and body. Message message = new Message().WithSubject(subject).WithBody(body); // Assemble the email. SendEmailRequ

Categories : C#

Batch File Connecting to Server and execute program install on connected server
Here's a little code to help you connect to the SQL server and interrogate the SQL version. @ECHO OFF SQLCMD /? > nul 2> nul IF ERRORLEVEL 1 ECHO.SQLCMD not found on this machine & PAUSE & GOTO :eof SET SQLCmdLine=SQLCMD -b -w400 REM use something like the next line for NT authentication; second line for SQL authentication REM for NT SET SQLCmdLine=%SQLCmdLine% -E -S "YourServerName" REM for SA SET SQLCmdLine=%SQLCmdLine% -U "YourSQLUserName" -P "YourSQLPassword" -S "YourServerName" SET Database=YourDatabaseName REM I will use NT Authentication for this example SET SQLCmdLine=%SQLCmdLine% -E -S "(local)" SET TestSQLCmdLine=%SQLCmdLine% -h-1 -d "%Database%" REM this will get the SQL version %TestSQLCmdLine% -Q "SELECT @@VERSION" | FINDSTR /v "rows affected" REM this will

Categories : SQL

BCP IN error : [Microsoft][SQL Server Native Client 10.0]Unexpected EOF encountered in BCP data-file
Oh, BTW, i was getting frustrated with the same issue today. Turns out the format file had a prefix length specifier that had a value of 2 (auto prompted during format file generation - why?) for field two which was a varchar field. Once I made it to field length specifier to 0, file started working. PS: my file was tab separated.

Categories : Csv

Hive Server 2 thrift Client error: Required field 'operationHandle' is unset
Are you really sure you set the operationsHandle field to a valid value? The Thrift eror indicates what it says: The API expects a certain field (operationHandle in your case) to be set, which has not been assigned a value. And you stack trace confirms this: Struct:TFetchResultsReq(operationHandle:null, orientation:FETCH_FIRST, maxRows:1)

Categories : Hadoop

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

iOS Client connecting to NodeJS socket.io results in Stream end encountered
Turns out that socket.io has its own authentication protocol and is not compatible with SocketRocket out of the box. See this SO answer: How to use SocketRocket with socket.io? From the answers there, you could take a look at socket.io-objc

Categories : IOS

Google Play Game Services client setup and connecting
All set! Finally after some tries without result, here is the method (suitable for libgdx users). Answer to the First Question: There's no need at all to get requests or even use the AuthUtil class provided by google. Answer to the Second Question: Make sure to read some tutorials about GamesClient and its implementation. Step1: Get the BaseGameUtils library provided by Google, here. Step2: implement GameHelper.GameHelperListenner on your MainActivity, for example: public class MainActivity extends AndroidApplication implements GameHelper.GameHelperListener and declare a GameHelper that will do all the sign in work for you. (dont forget to call its constructor and setup method, see GameHelper class for more information). Step3: call beginUserInitiatedSignIn() (from the GameHelpe

Categories : Android

Camelot Error: The client was not authorised by the server. Ensure that the ConnectionString property on the Connection is correct
This usually means that the credentials in the connectionstring is wrong, or connection wasn’t allowed from the client the authentication didn’t succeed from a client that is on a different domain Credential management It is important that the parameters in the connectionstring are correct, if you have used authentication=default you may try using the authentication=ntlm instead and remember to check and recheck that your user have access rights to the specified SharePoint Server and Site Allowing connections There is something called “loopback errors” that occurs internally in Windows. There are a lot of articles on how to work with this; we prefer the simple approach to solve this by using PowerShell Execute the following PowerShell command on each SharePoint frontend ser

Categories : Sharepoint

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#

Node.js terminates execution before script is finished, connecting via socket.io-client
I'd start by seeing if socket.io is throwing any errors: socket.on('error', function (exception) { console.log(exception); }); I'd also look to see if you're connecting to the right port. It's probable that the remote socket.io server is not on a default port.

Categories : Node Js

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#



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