w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How to list open ports in iOS?
The way I would do this is to have your app invoke the UNIX lsof command programmatically. lsof lists open "files", which on a BSD system includes sockets, which includes TCP sockets. It used to be that Saurik published a version of lsof that was available on Cydia. Unfortunately, I haven't been able to get that to work recently. You might try it yourself, as software from Saurik should generally be trustworthy. You could also try compiling the lsof source code yourself, as it's available online. However, I found a discussion thread about this here. User Firewire888 was able to get a homebuilt version of lsof working on iOS. If you trust their work, then you can download the binary file here. Per their instructions: On mac osx download ldid for macosx. https://networkpx.goo

Categories : IOS

Check that VPN ports are open
So, UDP doesn't do acks or connections like tcp does; so the only way to be sure the port is responding is to actually send some data and get a response (there is no requirement that it does respond though). Since these are specific ports, I assume that there is a specific application/protocol you are looking at. For that you basically need to open the port and either send it some garbage data or some form of identification payload (depending on the protocol). This previous question outlines what you need to do to handle that.

Categories : C#

how to append open ports to an already functional iptables?
The answer I have come up with is specific to Salt, but it works. The answer is not to use lokkit and use salt's native iptables state. https://salt.readthedocs.org/en/latest/ref/states/all/salt.states.iptables.html Simply use this state to append the additional ports you want opened.

Categories : Linux

Can you open access to UDP ports on an EC2 instance with Python?
Yes, there is. The specific AWS EC2 API functions are AuthorizeSecurityGroupIngress and RevokeSecurityGroupIngress. In boto, they map to the authorize and revoke methods of a boto.ec2.securitygroup.SecurityGroup instance. If you're in a VPC you need to add Egress methods, too.

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

Trying to open ports via Windows Firewall, but only when process is running (Error: "Syntaxerror")
start "Origin" /DE:Origin Origin.exe Guess only: The help for start indicates that there should be a SPACE between the D and the E.

Categories : Windows

how do i get javascript injected ouside of iframe to execute in global scope
How come you have an iFrame of a page that does an ajax call to controller/myview when you can do the ajax call in your main page instead? If you make the ajax call in your main html page, you can handle it in it's own scope which should eliminate the whole scope issue and also get rid of the redundant iFrame while you're at it. Sorry if I'm misinterpreting your question, it is a bit confusing.

Categories : Javascript

Thymeleaf object created from extednd broadleaf processor is made null when using th:each and is accesible only ouside th:each
It appears as if you are not properly closing the conditionals on your ternary functions. Add a } after the null and before the ? on each line. Here is an example ternary from the docs for reference 'User is of type ' + (${user.isAdmin()} ? 'Administrator' : (${user.type} ?: 'Unknown'))

Categories : Spring

Would compiler optimize conditional statement in loop by moving it ouside the loop?
That would greatly depend on how big /* code 1 */ is. If it is very small, it might. But if it is anything above a few lines, it most probably won't. Duplicating a large amount of code for every single if would have terrible effects on the performance. In fact, that may happen with very aggressive optimization and certainly not just with -O. From the man page of gcc (emphasis mine): -O -O1 ... With -O, the compiler tries to reduce code size and execution time, without performing any optimizations that take a great deal of compilation time. So reducing code is also part of optimization. -O2 Optimize even more. GCC performs nearly all supported optimizations that do not involve a space-speed tradeoff. As compared to -O, this option increases both compilation time and the

Categories : C

how submit grails form with submit button ouside form tag
You can use jquery to submit your form outside form tag as: <button class="some-class" onclick="jQuery('#formId').submit()">Submit</button> Enjoy programming..

Categories : Java

Com Ports in C# .Net 4.0
It is possible to use C# .Net 4.0 SerialPort class to achieve this communication. Please see the following links for information and support. This woman has written books (that I've used) and her forum is great for serial port communication. Everything you could possibly need is here: http://www.lvr.com/forum/index.php I also recommend the MSDN forum, as I find this very useful for .net. http://social.msdn.microsoft.com/Forums/en-us/home Here are some links to the MSDN for Serial Port Class with different frameworks. http://msdn.microsoft.com/en-us/library/system.io.ports.serialport.aspx http://msdn.microsoft.com/en-us/library/system.io.ports.serialport(v=vs.90).aspx It is impossible to cover the ins and outs of all the options with this type of coding. Various writeline, readline

Categories : C#

Which ports does android use?
Answer is, you cannot tell in general. This is not Android-specific, but depends on your App. You're free to choose the ports it communicates over. Usually, 80 and 443 shouldn't be blocked (http / https) - everything else depends on your App. What services do you use? If you never specified a port explicitly, they might imply one.

Categories : Android

One process uses two ports
There is no constraint on a process to use only one port. A process can use as many ports as it requires. Of course, there are limits to that, but those limits are much higher than 2 ports. For example, the number of available ports itself is only 64K. And also most of the processes would have a limit on the number of file descriptors (each socket needs to have one). But, once again, these limits are much higher than 2 ports.

Categories : C#

How to use non-standard ports?
There's an additional step you need to take when you manually specify a port to run on. Go into the project files and open config.json Append :8080 to the domain names specified like this: "$.nytimes.com:8080 => www.nytimes.com", etc..

Categories : Misc

Using bit fields for AVR ports
Handling race conditions must be done by operating system level calls (which will indeed use read-modify-writes), GCC won't do that. Idem., and no GCC does not generate read-modify-write instructions for volatile. However, a CPU will normally do the write atomically (simply because it's one instruction). This holds true if the bit-field stays within an int for example, but this is CPU/implementation dependent; I mean some may guarantee this up to 8-byte value, while other only up to 4-byte values. So under that condition, bits can't be mixed up (i.e. a few written from one thread, and others from another thread won't occur). The only way to set multiple fields at the same time, is to set these values in an intermediate variable, and then assign this variable to the volatile. The C stan

Categories : C

Completion ports (limits)
1) why not write a test to see. Chances are that it will be a) more than you could ever need, b) platform and memory specific and c) not a useful number to know. 2) define "by data type". In general your aim should be to have as few threads running as possible and having more than one IOCP means that you either have more threads running (or able to run) than you would have with a single IOCP OR you have the same number of threads and they are used less efficiently as some completions cause some threads to wake and run and others cause a different set of threads to wake and run. In general I'd need to know more about what you ACTUALLY want to do to be able to provide a more useful answer.

Categories : Misc

What to send over serial ports
The binary packet format is attractive because of its apparent simplicity and efficiency. Furthermore, some coomunication links are already sending data as packets of fixed size (USB, TCP/IP, file systems, etc.) but, if I had to do it differently, I would not go that way again because of the following drawbacks: not human readable (unless you want to obfuscate things and protect your protocol :-) ) computer architecture dependant: think about endianness problems toolchain dependancies: ex., how compiler X packs data structures versus compiler Y? link dependencies: if the link changes, what if there is an odd fit between protocol packet size and the new link packet size? JSON would be my way now: ASCII data transmissions are less efficient than binary transmissions, but its convenienc

Categories : Json

On Windows, libusb can't see some ports
I had some trouble concerning certain USB 3.0 ports as well, even though it was maybe a little different to your situation. So I am not quite sure if I can help you out, I believe it's more related to a hardware-issue. But keep in mind the following facts: USB 3.0 hardware is not yet well established (still under development) - some ports are loosing their functionality over the time, especially these quite cheap ones (built-in ports on mainboards with an Intel chipset). Because the current provided over USB 3.0 and the data rate is much higher than USB 2.0, it's not a miracle that these ports made of cheap wire break easily. Even using a different cable makes a difference, not speaking of hubs - they seem to be still prototypes, at least the ones I used. Keep looking regularly for the

Categories : C++

Multiple ports and threading
My question is should I use one thread to receive data from all different ports or should I create own thread for every port, each timed to run at 100ms interval? What is the good practice in these cases? It does not really matter that much. If you create one thread, you will have to keep track of the different ports. If you create multiple thread you have to keep track of all these threads. Since cpu's are usually multi-threaded nowadays I would go for multiple threads. As for the 100 ms timer interval, you can create one timer that loops through all threads and collects data from these threads. Make sure you lock it, so that if the timer elapses while the former event is still busy collecting data, these two don't interfere with each other.

Categories : Java

Arduino Ports Bitschift
Say you want to turn on the n'th bit of PORTD. PORTD |= (1<<n); Where the bits are numbered 0, 1, 2, etc from right to left. To turn off the 4th bit you would do PORTD &= ~(1<<4);

Categories : C++

Separate IPs From Ports using Shell Script?
Try something like this: #!/bin/bash ips="" # or get IPs from stdin # split them ips_array=($ips) for w in ${ips_array[@]} do echo $w | sed -e 's/:.*$//g' >> ips.txt echo $w | sed -e 's/^.*://g' >> ports.txt done Key is using the ($ips) to split the list up. EDIT: I just realized that you didn't format your question correctly so it's not a single line with IP:PORTs separated by spaces, but one on a line by itself. You just need this then: #!/bin/bash while read w do echo $w | sed -e 's/:.*$//g' >> ips.txt echo $w | sed -e 's/^.*://g' >> ports.txt done And you read from stdin.

Categories : Linux

IO Completion Ports and OVERLAPPED management
You should pass a the address of a OVERLAPPED * to GetQueuedCompletionStatus. This gets filled in with the value passed to PostQueuedCompletionStatus. You should not free this data in the PostQueuedCompletionStatus context. It should be done by the context using GetQueuedCompletionStatus. (Assuming it was allocated dynamically in the first place - there is no requirement that it is a dynamically allocated structure, it could be taken out of a fixed pool, or be allocated on the stack of a function that doesn't return until it has been signalled that the operation is complete). I'm not sure there is such a picture.

Categories : C++

How can I run two instances of tomcat 7.0 per eclipse different ports?
As per the screenshot, eclipse complains that "tomcat admin port" 8005 is already in use. Please change this under Ports ( in addition to changing http 1.1 and ajp1.3). I think you had mentioned that the port appears to be readonly. If that is the case, the port could be directly modified in the server.xml located in your workspace. File location: <>ServersTomcat v7.0 Server at localhost-configserver.xml Locate the following line in server.xml and modify it. Refresh your eclipse and it should reflect in the UI. <Server port="8005" shutdown="SHUTDOWN">

Categories : Eclipse

How to access GSM modem ports via C++ program
If you have the correct driver for your USB device, Windows will show your device as COM port (e.g COM3). You can access the COM port from your code, and manipulate the settings. Your question seems very generic about serial port, so I couldn't be specific. However, here is some help http://msdn.microsoft.com/en-us/library/ff802693.aspx , http://www.codeguru.com/cpp/i-n/network/serialcommunications/article.php/c5425/Serial-Communication-in-Windows.htm

Categories : C++

How to capture packets in localhost between two ports
On Linux you can use netstat to determine the ports that your application are using. Then you can use Wireshark to capture on the loopback interface (just enter your own IP address if dont work). Refer to: https://stackoverflow.com/questions/1566234/ for capturing on Windows.

Categories : Sockets

VB Socket Exception Issue - Ports
Along the lines of Hans's comment, you are probably calling serverMode more than once through the life of your program. The one thing I noticed is that in your finally block you are not calling .Stop on your server, which means its possible to exit serverMode without shutting it down. Once that happens, repeated calls to start the server will likely fail.

Categories : Vb.Net

Is it possible to use different ports for nodes in a Cassandra cluster?
take a look at https://github.com/pcmanus/ccm , they are using multipe cassandra instances on the same node. you can see how they are doing it.

Categories : Cassandra

How to edit System.IO.Ports in Mono?
In order to apply the patch you will have to build mono from source, there is a very thorough guide for that on github. But before doing that i would: Test that this isn't fixed in the newest mono version Find out if there is a workaround that doesn't require changing mono source

Categories : C#

How to free stuck server ports?
https://github.com/joyent/node/blob/3d4c663ee68326990e0732a4aa76445688e1064e/lib/net.js#L1159 You are passing invalid arguments to server.listen. It is interpreting your string as a unix domain socket filesystem path. This program works fine and can be killed and restarted immediately. net = require "net" server = net.createServer -> console.log "connection" server.listen 1337, "" Pass correct arguments to server.listen and all is well.

Categories : Node Js

Assigning vhosts to Docker ports
Here are two possible answers: (1) setup ports directly with Docker and use Nginx/Apache to proxy the vhosts, or (2) use Dokku to manage ports and vhosts for you (which is how I learned to do Method 1). Method 1a (directly assign ports with docker) Step 1: Setup nginx.conf or Apache on the host, with the desired port number assignments. This web server, running on the host, will do the vhost proxying. There's nothing special about this with regard to Docker - it is normal vhost hosting. The special part comes next, in Step 2, to make Docker use the correct host port number. Step 2: Force port number assignments in Docker with "-p" to set Docker's port mappings, and "-e" to set custom environment variables within Docker, as follows: port=12345 # <-- the vhost port setting used in ngi

Categories : Nginx

Detect conflicting forwarded ports on VM
I would recommend using a combination of netstat and VBoxManage and parse the output. You can easily replace the findstr command with grep on non-Windows hosts. First, I would get a listing of NAT ports on the VM in question. The VBoxManage showvminfo command will output a bunch of info about the configuration which you can filter to look for just the NAT rules. You will want to look for the host port and protocol fields in the output (and possibly host ip if configured) as that is what you will be looking to see if it is already in use. C:>vboxmanage showvminfo Linux | findstr Rule NIC 1 Rule(0): protocol=tcp, host ip=, host port=2222, guest ip=, guest port=22 Second, using the info from above I know I need to check if anything is listening on port TCP port 2222, so I can use the

Categories : Networking

How to get tcp/udp ports list of target application
this will give you list of ports being used, and netstat source code from net-tools suite may be of help to you

Categories : C++

What is a good way to have couchdb listen on 2 ports?
One way to do that is to have a reverse HTTP proxy running on the 2nd port and redirecting to the first. You could use Nginx or Apache. Another option is using iptables to do the redirecting. This option is best from a performance standpoint but not very portable.

Categories : Osx

How can I quickly find VMs with serial ports in PowerCLI
Appending to arrays ($arr += $newItem) in a loop doesn't perform well, because it copies all existing elements to a new array. This should provide better performance: $ProbDevices = $vm.ExtensionData.Config.Hardware.Device ` | ? { $_.GetType().Name -eq 'VirtualSerialPort' } ` | % { $_.DeviceInfo.Label }

Categories : Powershell

Meteor ports used (seems to be blocked by wireless network)
It sounds a bit like the websocket bit of the connection isn't connecting through. In meteor there are two connections, one static containing the html, images and js (which looks like its working) and the other via websockets which handles the data & live updates. You could check in Chrome's javascript error console for a 400 websocket error, in which case it tries to drop to long polling, which takes quite a while. It might be something like a proxy which is troubling you. I've run into this without a HTTP proxy but a invisible socks proxy too (via iptables). You could check quickly too by checking Meteor.status() which would indicate its 'waiting' if the above is the case.

Categories : Meteor

Multiple Serial Ports in C# / Trouble using List <>
The simplest approach would be to use a lambda expression which would capture the port you're using. A lambda expression is a way of building a delegate "inline" - and one which is able to use the local variables from the method you declare it in. For example: foreach (var port in portNames) { // Object initializer to simplify setting properties SerialPort sp = new SerialPort(port, 19200, Parity.None, 8, StopBits.One) { Handshake = Hanshake.None, ReadTimeout = 500, WriteTimeout = 500 }; sp.DataReceived += (sender, args) => { Thread.Sleep(500); // Not sure you need this... string data = sp.ReadLine(); Action action = () => { MessageBox.Show(data.Trim()); sp.Close(); }; Beg

Categories : C#

How to determine all the default ports used by Hadoop and change all of them?
You can find out the ports that a particular process has open by using the netstat command, combined with a little bash one liner. I don't have hadoop up on my machine at the moment, so here's an example to find out what port sshd is running on (should be 22!): You'll need to know the process id of you hadoop processes (TT, JT, NN, DN etc), which can be found by doing another oneliner, so for my sshd example: #> sudo ps axww | grep sshd 1065 ? Ss 0:00 /usr/sbin/sshd -D You can replace sshd in the grep for hadoop and it will catch most of the processes running on that node. Now we can use another one liner to find out what ports sshd has open for LISTENing (process id 1065): #> sudo netstat -alpn | grep 1065 | grep LISTEN tcp 0 0 0.

Categories : Hadoop

IO.Ports exception throw and retry loop
I am not sure what you are asking, but I think you should list the available ports before choosing one. The following code may work; it compiles, but it is not tested. This is also not a good way to do it. A better way would be to list the ports before you plug in your device, then list the ports again to see the new port that showed up after you plugged in the device. SerialPort port; bool isCorrectPortFound = false; // Try different ports until a device reacts when a character is written to it while (!isCorrectPortFound) { // Get all open ports string[] ports = SerialPort.GetPortNames(); // Menu choice for a port to select char portSelect = '0'; // Write the port names to the screen foreach (string s in ports) { portSelect++; Console.Writ

Categories : C#

N-Layer to Hexagonal (Ports and Adapters) architecture
I was looking for this myself. Alistair Cockburn has an example with an explanation that might help you out and there was an example was given at this conference.

Categories : Misc

Peek into local network messages on set ports (using C#RMI)
Are you going across the internet? Then probably Are you on an internal network, behind a firewall, with trusty employees, then its probably not worth the hassle. HTTP is not encrypted, and neither is about 80% of SMTP communication. It all depends how sensitive your not so sensitive data is.

Categories : C#

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