w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
While Sending Html Mails from my web application Recieved Mails contains Symbols like &ldquo,&rdquo, ‘
Check with another constructor for htmlView: ContentType mimeType = new System.Net.Mime.ContentType("text/html"); var htmlView = AlternateView.CreateAlternateViewFromString(bodyMessage, mimeType);

Categories : Asp Net Mvc

difference between the destination IP of a crafted packet and the destination ip argument of raw socket send()
The answer for BSD is a comment in the source code for rip_output():1 "If the user handed us a complete packet, use it. Otherwise, allocate an mbuf for a header and fill it in" [i.e., from the address provided to sendto()]. For other systems you're going to have to read some kernel source code. G.R. Wright & W.R. Stevens, TCP/IP Illustrated, vol II: The Implementation, pp.1057-1062.

Categories : Networking

If a host doesn't know which net the destination is in, how will package be sent
The routing is entirely based on the destination address and the routing table (which will vary depending on the configuration of your subnet). Lets suppose that, Host A is 10.3.4.4 and is configured with netmask 255.255.255.0 and a router of 10.3.4.1 Host B is 10.3.3.3 and is configured with netmask 255.255.255.0. In this case the routing table for host A will look something like, Dest Gateway Mask 0.0.0.0 10.3.4.1 0.0.0.0 10.3.4.0 0.0.0.0 255.255.255.0 Starting at the bottom, host A will attempt to find which route to use. If host A tries to contact 10.3.4.x, it will match the first route, and instead of using a gateway it will send an ARP request "who has 10.3.4.x?" on the subnet broadcast address (10.3.4.255). If host A tries to contact host B, it won't match th

Categories : Networking

Abrupt termination of server (Socket operation on non-socket)
This is actually a linux problem, because you're trying to use recv and send to read from and write to STDIN (which is probably a terminal not a socket). Unlike most UNIX variants, in Linux, send and recv can only be used on sockets, not on any file descriptor. For a terminal, you need to use read and write. There's also the issue that it's weird to write to STDIN -- normally you only read from STDIN and write to STDOUT. But as long as STDIN is somethine like a terminal you can write to, it would be ok.

Categories : C

C9.IO - Debugging Failed - Failed to open socket on port 15400, waiting 1000 ms before retrying
Looks like an older process is already running . You have to kill the older process yourself. See the solution posted here : https://github.com/ajaxorg/cloud9/issues/2170.

Categories : Node Js

SFTP: how to know if i'm connecting to a unix or windows host?
There is a number of possible ways to complete your task, however I'm not sure if your libraries support them: SFTP protocol contains SSH_FXF_TEXT_MODE file open flag, allowing to open file in text mode, translating EOL sequences to CRLF (available since version 6 of protocol, AFAIR). 'newline' SFTP extension - it tells exact server's EOL convention Parsing SSH server software/version string.

Categories : Java

Having trouble with connecting SQLite in host Java
SQLite does not handle remote databases very well. According to their Appropriate Uses For SQLite page, "... Another way to look at SQLite is this: SQLite is not designed to replace Oracle. It is designed to replace fopen()." When you connect to an SQLite DB, you can only do it if you have direct access to the database file. If the file is shared on a remote drive, you can probably use jdbc:sqlite:\hostnameXX.sqlite as your connection string, but only if you can see the file that way in Windows explorer. On the other hand, you may want to try to install a database that intentionally allows remote connections. Apache Derby is a good one with a small footprint. It is written in Java and has a very nice and easy to use JDBC driver. Derby is available at http://db.apache.org/derby/.

Categories : Java

Connecting to https host with soapclient: how to fix SSL problems?
Interesting. Try adding this: wget https://[[SERVER]]/soap/ —post-file=request.xml —header=”Content-Type: text/xml” -O response.xml This will save the result as a file named response.xml.

Categories : PHP

Connecting to WiFi host using Bonjour on iPhone
This should give you enough to get started. You'll also learn the basics of the networking necessities that you will need. Networking an Bonjour on iPhone. Or you could just see the Apple Docs here.

Categories : Iphone

strange mongodb behavior when connecting to invalid host/port combination
Default driver is never to timeout or whatever is the os default timeout (I think it's 30 min on linux bot not completely sure). You can tweak it yourself as the link above show. But don't set it to small or you'll continuously get timeouts and reconnects

Categories : Node Js

Connecting to a udp socket in Node.js
You need to use the addMembership() method to join a multicast group, in UDP you don't connect to servers, a connection is never created and there is no guarantee that you will receive any/all packets. You join a multicast group and receive packets with that group-id that reach your network card, the python method name is misleading. http://nodejs.org/api/dgram.html#dgram_socket_addmembership_multicastaddress_multicastinterface

Categories : Python

Trouble connecting to Postgresql database in Vagrant guest box with Induction from host machine?
check file pg_hba.conf looks like require allow connection most easy and lesss secure set 'trust' (everyone can use your postgresql) http://www.postgresql.org/docs/9.2/static/auth-pg-hba-conf.html

Categories : Postgresql

Connecting to gdb failed
MinGW does not come with GDB (well it does but you need some more work). You are trying to debgu with dgb. Install gdb debugger. Try this question Alternatively, I suggest you use visual studio for debugging Good luck

Categories : C++

Synchronously connecting to a socket in node js
After adding the missing "require" statements and the server.listen() call to get the script to run, it works fine for me: var http = require('http'); var Socket = require('net').Socket; var server = http.createServer(function(req, res){ var sock = new Socket(); sock.connect(80, "www.google.com", function(){ console.log("Connected to google.."); sock.write("GET / "); }); sock.on("data", function(data){ console.log(data.toString()); res.writeHead(404, {"Content-type": "text/plain"}); res.write(data, "binary"); res.end(); sock.end(); }); sock.on("end", function(){ console.log("Disconnected from socket.."); }); }); server.listen(8080);

Categories : Javascript

socket.io error when connecting from iframe
You have encountered Same Origin Policy. The simplest solution is to run the iframe from the same server. Since you have access to I.T time read up on CORS You will basically have to configure the server to allow XSS from your domain. You can also try something like: document.domain = "intranet" Read up on it here

Categories : Javascript

Connecting C socket server from PHP using PHP Extension
Debug your code properly, could you receive parameters in your C Client code passed from PHP function call, I hope you will not get the parameters which you are passed from PHP function call. Check your parameters receive section, there you have to check the type of values sending from PHP should match the type of declaration in your C Client socket connection scripts. I hope replace your receive parameters section with my following code, it will work. if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ls|b", &i_iPortNumber, &i_pcIPAddress, &return_long) == FAILURE) { RETURN_NULL(); }

Categories : PHP

How to make more than 1 socket to the same host and port?
This error message means that there is no open port on that IP. The IP is valid but the remote host replied that it will not accept a connection on this port. You should be getting this error even for the very first connection. Find out why the port is not open. Btw, you use of async connect is counter-productive. You have non of the async benefits and all of the disadvantages. But this is not the point of this question.

Categories : C#

Python socket not sending host name
IS that DETClient the actual implementation? Because it's missing instantiations of both host and port for that instance? in self.connect you're using self.host and self.port, which both evaulate to None since you havent set them yet. class DETClient(asyncore.dispatcher): def __init__(self, host, port): self.host = host #<---- this is missing self.port = port #<---- this is missing asyncore.dispatcher.__init__(self) self.create_socket(socket.AF_INET, socket.SOCK_STREAM) self.connect((self.host,self.port))

Categories : Python

PULL socket not connecting fast enough to ROUTER
Why is this happening? You have a race condition. The client1.connect call starts the connection process, but there is no guarantee the actual connection is established when you call rtr.sendMore("client1");. Your sleep() workaround pretty much proves this. Changing PULL to DEALER is a step in the right direction, because DEALER can send and receive. In order to avoid the need for sleeps and waits you would have to change your protocol. A simple change to the code above would be to have the DEALER connect and then immediately send a "HELLO" message to the ROUTER (could be just an empty message). The router code must be redesigned such that it does nothing until it receives a HELLO message from the DEALER. Once you have received the HELLO message you know the connection is succes

Categories : Java

Host Java Server using Socket Communication
To run a custom server of your own you're going to need VPS and those are not free. Some services such as Amazon have a free usage tier though so you can get started without extra costs.

Categories : Java

Connecting to a bluetooth device programatically
There might be a timing problem, onCreate and onResume are called in very short order. In the case that the BT is not enabled the code in onResume might be called before the BT service is online. My advice: Try to delay the initiation a few seconds by putting the code in a Runnable. private Handler mHandler = new Handler(); public void onCreate() { [...] mHandler.postDelayed(new Runnable() { @Override public void run() { btAdapter.enable(); // Set up a pointer to the remote node using it's address. BluetoothDevice device = btAdapter.getRemoteDevice(address); // Two things are needed to make a connection: // A MAC address, which we got above. // A Service ID or UUID. In this

Categories : Android

Android: connecting two device without internet
Socket connection would be a great idea in your situation, you dont need to have Internet to do so. Here is one of many examples if you google it: http://examples.javacodegeeks.com/android/core/socket-core/android-socket-example/ Hope this helps

Categories : Android

Connecting android device over TCPIP
According to a page I just read the server can only start in the ports numbered 5555 to 5585. "One thing to remember is that you can only choose a port number within the range of [5555...5585] (the reason being that ADB Server only works with these ports). So for instance you could do: adb tcpip 5555" (via http://www.chentir.com/?p=1613)

Categories : Android

Connecting IOS Device to IBM DB2 using JDBC Bridge
Yes it is possible to realise such an application. IBM Data Studio allows you to generate a REST or SOAP-based web service that you can then deploy in a Java container of your choice. More details on IBM DeveloperWorks.

Categories : IOS

Connecting Android device for debugging
You can check the link below. http://developer.android.com/tools/device.html "the vendor ID is for HTC. The MODE assignment specifies read/write permissions, and GROUP defines which Unix group owns the device node." from android.com

Categories : Android

Connecting my android device to eclipse
Ok, This did it for me. Connected Xperia E to my laptop. Enabled USB Debugging. Went to the Computer > Right Click > Manage > Device Manager > Other Devices > Android ADB Interface > Right Click > Update Driver > Browse my computer for Driver Software > Let me pick from a list of device drivers on my computer .Now, here is the MAIN part. Instead of looking for Android ADB Interface, scroll down & you will find a driver named Sony so0101 . Click next & install it. Now, Eclipse detects my device !! NOTE : USB DEBUGGING must be enabled ,otherwise the device (XPERIA E) will show under portable devices and no Android ADB Interface will be present to update. Hope, it helps someone as it took me two days to figure it out ! Cheers !

Categories : Android

Failed to add the host to the list of know hosts
Shouldn't known_hosts be a flat file, not a directory? If that's not the problem, then this page on Github might be of some help. Try using SSH with the -v or -vv flag to see verbose error messages. It might give you a better idea of what's failing.

Categories : Github

Selenium Webdriver: INFO: I/O exception (java.net.BindException) caught when connecting to the target host: Address already in use: connect
This question solves this problem It's the info-level message. Don't worry about it.

Categories : Java

C#, Metro, Stream Socket, SSL Untrusted Host, Squid
I did it by modifying the Control of the StreamSocket that way : _streamSocket.Control.IgnorableServerCertificateErrors.Add(ChainValidationResult.Untrusted); _streamSocket.Control.IgnorableServerCertificateErrors.Add(ChainValidationResult.InvalidName); ChainValidationResult contains multiple options, choose the one best suited for you.

Categories : C#

about copying structure from host to device
If the structures have no pointers in them (i.e. no dynamically allocated data) then copying is relatively straightforward: #define DSIZE 100 typedef struct { float velocity; float temperature; float pressure; } mystruct; int main () { mystruct *h_data, *d_data; h_data = (mystruct *) malloc(DSIZE * sizeof(mystruct)); // populate h_data cudaMalloc((void **)&d_data, DSIZE * sizeof(mystruct)); cudaMemcpy(d_data, h_data, DSIZE * sizeof(mystruct), cudaMemcpyHostToDevice); ... } If the structures contain dynamically allocated data: typedef struct { float *velocity; float *temperature; float *pressure; } mystruct; Then the process involves extra steps.

Categories : Visual C++

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

Connecting Android to a device with an Unknown UUID
UUID is meant to identify services , not devices. Devices are recognized by a bluetooth address which is exactly like a MAC address for Laptops/PCs. Frankly, the answer to your question is very huge considering your lack of knowledge about the subject. I suggest you start with some basic understanding of bluetooth programming. You could start with this: Bluetooth Essentials for Programming by Albert Huang and Larry Rudolph I'm sure you can find this ebook for free online if you look around.

Categories : Android

Connecting Your Own Device On Eclipse safely to run Application
It is perfectly safe to test the app (game) on your phone. Eclipse is not actually running on your device. What it does is it sends an install package to your phone that installs your app in much the same manner as if it was installed from anywhere else in normal way. What Eclipse does in addition is that it is sniffing on some log messages that is written by the apps. This is perfectly safe. Since you have already installed Samsung Kies on your computer, you will have the necessary drivers installed. All you need to do is to open your project in Eclipse, and then run as Android Application. Then you are prompted to run on a device, you select your phone from the list of running devices. When you click OK on this, your app will be sent to your phone as an .apk file, and then installed

Categories : Android

Callback on device connecting to Wifi Hotspot
If you don't need to use the AP to connect to the internet but just to communicate in a LAN, you can create a P2P group with WifiP2pManager instance createGroup and listen to WifiP2pManager.WIFI_P2P_CONNECTION_CHANGED_ACTION with a broadcast receiver. Like this: if (WifiP2pManager.WIFI_P2P_CONNECTION_CHANGED_ACTION.equals(action)){ NetworkInfo networkInfo = intent.getParcelableExtra(WifiP2pManager.EXTRA_NETWORK_INFO); if (networkInfo.isConnected()) { Manager.requestConnectionInfo(mChannel, new WifiP2pManager.ConnectionInfoListener(){ @Override public void onConnectionInfoAvailable(final WifiP2pInfo info) { if (info.isGroupOwner) { mManager.requestGroupInfo(mChannel, new WifiP2pManager.GroupInfoLi

Categories : Android

How to do socket operation when application entered background?
It will start a thread's run loop, which waits for inputs like timers and touch events. Someone thought they could be clever and force the system to keep running in the background here but this is likely just going to get the application killed by the OS. – borrrden

Categories : Iphone

TCP Socket Data Send/Recv Operation
You are not guaranteed to get all the data from a single Send() within a single Receive(). The TCP algorithm transparently splits your data into individual packets, and there's no direct API control over how big the packets are, or how data gets split when it's too big for a single packet. See Nagle's algorithm for the gory details of how TCP does this under the hood. If you want to control exact packet contents and send timing, you should consider the packet based protocol UDP instead.

Categories : C#

Host key verification failed using gitlab and jenkins
If you make the repo you are trying to connect to public in Gitlab (Settings -> Edit Project -> Public mode) you should be able to connect using http (but only http). If the repo is not public you will need to install an SSH key on Jenkins that has permissions to access the repo. My understanding is that the Jenkins git plugin does not currently use the SSH credentials already stored in Jenkins so you will need to install the key on the master and slaves that will run this build. How you do this will depend on your OS but I find it easiest to use an SSH config file on Linux.

Categories : Jenkins

UDP Socket: An existing connection was forcibly closed by the remote host
In BeginReceiveFrom your remoteEP should indentify the socket that is listening, mostly the same endpoint that you have used for the Bind. And in your callback method ReceiveCallbackUDP you should call EndReceiveFrom, as this is the corresponding Method to BeginReceiveFrom: EndPoint tempRemoteEP = (EndPoint)client.remoteEndpoint; int bytesRead = UDPSocket.EndReceiveFrom(ar, ref tempRemoteEP); See the Example in http://msdn.microsoft.com/en-us/library/system.net.sockets.socket.beginreceivefrom.aspx, where tempRemoteEP passed to BeginReceiveFrom is the same Endpoint as sender passed to Bind.

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

Socket Connecting and Sending Data Received but not read on ASP.net side from Android
The Read() call on the netStream fills the data into the rcvBuffer, but then you try to get your string from the data buffer... and you read two times before you try to get the string, once before the while and once inside the while. Maybe you can use a do{}while() loop.

Categories : C#



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