System.IO.FileNotFoundException when running TCP Socket client tutorial in Windows Phone 8 - sockets

I'm trying to run the How to create and use a TCP socket client app for Windows Phone but get the following errors ...
An exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.ni.dll and wasn't handled before a managed/native boundary
An exception of type 'System.Net.Sockets.SocketException' occurred in System.Net.ni.dll and wasn't handled before a managed/native boundary
An exception of type 'System.Net.Sockets.SocketException' occurred in System.Net.ni.dll and wasn't handled before a managed/native boundary
An exception of type 'System.Net.Sockets.SocketException' occurred in System.Net.ni.dll and wasn't handled before a managed/native boundary
An exception of type 'System.Net.Sockets.SocketException' occurred in System.Net.ni.dll and wasn't handled before a managed/native boundary
I have the Simple IP services running on my dev computer and the phone is linked via USB when debugging. It does not suggest in the article what you should use for the IP address to reach the dev computer from the phone - I have tried,
192.168.1.66 // Dev computer address on lan
whitby // Dev computer name
127.0.0.1 // Localhost, refers to dev computer or phone?
localhost // ditto
I'm guessing as well, if the host was wrong I would get a nice error message - instead, nothing (i.e. empty string) is echoed back from e.SocketError.ToString()
I am using Windows Phone 8.

Actually, I've figured it out. I was used to Windows Phone 7 programming and it seems that the System libraries throw exceptions as a matter of course in Windows Phone 8 - the app continues to run.
The problem was that the firewall was blocking the Simple IP services ports. To get the to work you can temporarily disable the Windows Firewall:
Type 'Firewall' at the Start Menu to get the 'Windows Firewall with Advanced Security' client
Click 'Windows Firewall Properties'
Under the 'Private Profile' tab, set the 'Firewall State' to 'Off' temporarily
Then connect using the IP of the dev computer e.g. 192.168.1.66 (not localhost, 127.0.0.1 etc.)

Related

failed to find free socket port for process dispatcher when trying remote debug

Highlights:
windows 10 host machine
ubuntu vagrant box (virtualbox) as guest vm
using vagrant port forwarding as like this: config.vm.network "forwarded_port", guest: 1234, host: 12340
IDE: IntelliJ IDEA with Ruby plugin
The Issue:
I've tried to set up remote ruby debug following this guide and getting an error in IDE: "failed to find free socket port for process dispatcher". It looks this issue is not IntelliJ-specific, I was able to reproduce it with latest RubyMine as well.
From IDEA's log
2017-07-07 21:53:03,515 [8879188] INFO - tion.impl.ExecutionManagerImpl - Failed to find free socket port for process dispatcher
com.intellij.execution.ExecutionException: Failed to find free socket port for process dispatcher
at org.jetbrains.plugins.ruby.ruby.debugger.RubyProcessDispatcher.<init>(RubyProcessDispatcher.java:46)
at org.jetbrains.plugins.ruby.ruby.debugger.RubyRemoteDebugRunner.doExecute(RubyRemoteDebugRunner.java:62)
...
Caused by: java.net.BindException: Address already in use: JVM_Bind
at java.net.TwoStacksPlainSocketImpl.socketBind(Native Method)
at java.net.TwoStacksPlainSocketImpl.socketBind(TwoStacksPlainSocketImpl.java:137)
...
I can understand it says Address already in use: JVM_Bind, but how remote debug supposed to work at all then? (I mean Is there any way to access guest vm port not forwarding it before? Clearly no) Any help to solve this issue is much appreciated.
For me the issue was due to another debug session that was open in the background. To prevent that from happening again (and also close all other currently open sessions, once you run the configuration again) select "Single instance only" in the Debug Configuration:

Socket error 10053 software caused connection abort

I have a application which will receive files from FTP and uploaded in to Mainframe server.
I am getting a "Socket error 10053 software caused connection abort" when I assign
FTPTransfertype = ftASCII
If I change this to FtBinary I'm not getting this error but data not uploaded properly in this mode.
I am getting this error only in application server (Production server) not in the development server (here I faced this issue only once in the FTPTransfertype = ftASCII assignment)
I have changed the FTP connectivity mode to Passive but its not working..
Please help me on this.
I recomment to see Microsoft Windows Socket Errors page:
https://msdn.microsoft.com/en-us/library/windows/desktop/ms740668(v=vs.85).aspx
In your case:
Software caused connection abort. An established connection was
aborted by the software in your host computer, possibly due to a data
transmission time-out or protocol error.

Mongodump utility raise SocketException

When I try to backup my database using mongodump utility it raises the next exception:
2014-09-02T14:33:00.883+0400 Socket recv() errno:10055 An operation on a socket
could not be performed because the system lacked sufficient buffer space or beca
use a queue was full. 127.0.0.1:27017
2014-09-02T14:33:00.883+0400 SocketException: remote: 127.0.0.1:27017 error: 9001 socket exception [RECV_ERROR] server [127.0.0.1:27017] assertion: 16465 recv failed while exhausting cursor
MongoDB version: 2.6.1
OS: Windows Server 32-bit
From what I've found on MSDN it's a Windows problem
When you try to connect from TCP ports greater than 5000 you receive the error 'WSAENOBUFS (10055)' Print Print Email Email
And the solution quoted from the Windows Help Center is:
The default maximum number of ephemeral TCP ports is 5000 in the products that are included in the "Applies to" section. A new parameter has been added in these products. To increase the maximum number of ephemeral ports, follow these steps:
Start Registry Editor.
Locate the following subkey in the registry, and then click Parameters:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
On the Edit menu, click New, and then add the following registry entry:
Value Name: MaxUserPort
Value Type: DWORD
Value data: 65534
Valid Range: 5000-65534 (decimal)
Default: 0x1388 (5000 decimal)
Exit Registry Editor, and then restart the computer.
You can find more details about the issue and the detailed description of the solution by going to the Windows Support Center

Intellij unitest Exception encountered when invoking run on a nested suite - java.net.BindException: Permission denied

I am new to scalatest and when I finished the project I add a test file.
Is there any place that I should particularly pay attention to?
I met this problem when I want to run a unitest in intelli idea
/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/bin/java -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:50594,suspend=y,server=n -Dfile.encoding=UTF-8 -classpath "/Users/xuyin/Library/Application Support/IdeaIC13/Scala/lib/scala-plugin-runners.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/lib/ant-javafx.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/lib/dt.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/lib/javafx-doclet.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/lib/javafx-mx.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/lib/jconsole.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/lib/sa-jdi.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/lib/tools.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/deploy.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/htmlconverter.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/javaws.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/jce.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/jfr.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/jfxrt.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/JObjC.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/jsse.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/management-agent.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/plugin.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/resources.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/rt.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/ext/dnsns.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/ext/localedata.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/ext/sunec.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/ext/sunjce_provider.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/ext/sunpkcs11.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/ext/zipfs.jar:/Users/xuyin/codebase/api-server/target/scala-2.10/test-classes:/Users/xuyin/codebase/api-server/target/scala-2.10/classes:/Users/xuyin/.sbt/boot/scala-2.10.1/lib/scala-library.jar:/Users/xuyin/.ivy2/cache/com.typesafe.slick/slick_2.10/jars/slick_2.10-1.0.0.jar:/Users/xuyin/.ivy2/cache/org.slf4j/slf4j-api/jars/slf4j-api-1.6.4.jar:/Users/xuyin/.ivy2/cache/org.slf4j/slf4j-nop/jars/slf4j-nop-1.6.4.jar:/Users/xuyin/.ivy2/cache/com.h2database/h2/jars/h2-1.3.166.jar:/Users/xuyin/.ivy2/cache/mysql/mysql-connector-java/jars/mysql-connector-java-5.1.13.jar:/Users/xuyin/.ivy2/cache/org.scalaquery/scalaquery_2.9.1-1/jars/scalaquery_2.9.1-1-0.10.0-M1.jar:/Users/xuyin/.ivy2/cache/com.twitter/finagle-core_2.10/jars/finagle-core_2.10-6.2.0.jar:/Users/xuyin/.ivy2/cache/io.netty/netty/bundles/netty-3.5.5.Final.jar:/Users/xuyin/.ivy2/cache/com.twitter/util-core_2.10/jars/util-core_2.10-6.2.0.jar:/Users/xuyin/.ivy2/cache/com.twitter/util-collection_2.10/jars/util-collection_2.10-6.2.0.jar:/Users/xuyin/.ivy2/cache/com.google.guava/guava/jars/guava-13.0.1.jar:/Users/xuyin/.ivy2/cache/com.google.guava/guava/jars/guava-11.0.2.jar:/Users/xuyin/.ivy2/cache/commons-collections/commons-collections/jars/commons-collections-3.2.1.jar:/Users/xuyin/.ivy2/cache/com.twitter/util-hashing_2.10/jars/util-hashing_2.10-6.2.0.jar:/Users/xuyin/.ivy2/cache/com.twitter/util-jvm_2.10/jars/util-jvm_2.10-6.2.0.jar:/Users/xuyin/.ivy2/cache/com.twitter/util-logging_2.10/jars/util-logging_2.10-6.2.0.jar:/Users/xuyin/.ivy2/cache/com.twitter/util-app_2.10/jars/util-app_2.10-6.2.0.jar:/Users/xuyin/.ivy2/cache/com.twitter/finagle-http_2.10/jars/finagle-http_2.10-6.2.0.jar:/Users/xuyin/.ivy2/cache/com.twitter/util-codec_2.10/jars/util-codec_2.10-6.2.0.jar:/Users/xuyin/.ivy2/cache/commons-codec/commons-codec/jars/commons-codec-1.6.jar:/Users/xuyin/.ivy2/cache/commons-codec/commons-codec/jars/commons-codec-1.5.jar:/Users/xuyin/.ivy2/cache/commons-lang/commons-lang/jars/commons-lang-2.6.jar:/Users/xuyin/.ivy2/cache/com.twitter/finagle-ostrich4_2.10/jars/finagle-ostrich4_2.10-6.2.0.jar:/Users/xuyin/.ivy2/cache/com.twitter/ostrich_2.10/jars/ostrich_2.10-9.1.0.jar:/Users/xuyin/.ivy2/cache/com.twitter/util-eval_2.10/jars/util-eval_2.10-6.1.0.jar:/Users/xuyin/.sbt/boot/scala-2.10.1/lib/scala-compiler.jar:/Users/xuyin/.ivy2/cache/org.scala-lang/scala-reflect/jars/scala-reflect-2.10.1.jar:/Users/xuyin/.ivy2/cache/com.twitter/scala-json_2.10/jars/scala-json_2.10-3.0.1.jar:/Users/xuyin/.ivy2/cache/net.liftweb/lift-json_2.10/jars/lift-json_2.10-2.5.jar:/Users/xuyin/.ivy2/cache/org.scala-lang/scalap/jars/scalap-2.10.0.jar:/Users/xuyin/.ivy2/cache/com.thoughtworks.paranamer/paranamer/jars/paranamer-2.4.1.jar:/Users/xuyin/.ivy2/cache/log4j/log4j/bundles/log4j-1.2.16.jar:/Users/xuyin/.ivy2/cache/log4j/log4j/jars/log4j-1.2.14.jar:/Users/xuyin/.ivy2/cache/com.github.sgroschupf/zkclient/jars/zkclient-0.1.jar:/Users/xuyin/.ivy2/cache/org.apache.zookeeper/zookeeper/jars/zookeeper-3.3.3.jar:/Users/xuyin/.ivy2/cache/jline/jline/jars/jline-0.9.94.jar:/Users/xuyin/.ivy2/cache/junit/junit/jars/junit-3.8.1.jar:/Users/xuyin/.ivy2/cache/org.scalatest/scalatest_2.10/jars/scalatest_2.10-1.9.1.jar:/Users/xuyin/.ivy2/cache/org.scala-lang/scala-actors/jars/scala-actors-2.10.0.jar:/Users/xuyin/.ivy2/cache/com.github.tomakehurst/wiremock/jars/wiremock-1.33.jar:/Users/xuyin/.ivy2/cache/net.sf.jopt-simple/jopt-simple/jars/jopt-simple-4.3.jar:/Users/xuyin/.ivy2/cache/com.fasterxml.jackson.core/jackson-core/jars/jackson-core-2.1.2.jar:/Users/xuyin/.ivy2/cache/org.mortbay.jetty/jetty/jars/jetty-6.1.26.jar:/Users/xuyin/.ivy2/cache/org.mortbay.jetty/jetty-util/jars/jetty-util-6.1.26.jar:/Users/xuyin/.ivy2/cache/org.mortbay.jetty/servlet-api/jars/servlet-api-2.5-20081211.jar:/Users/xuyin/.ivy2/cache/com.jayway.jsonpath/json-path/bundles/json-path-0.8.1.jar:/Users/xuyin/.ivy2/cache/net.minidev/json-smart/jars/json-smart-1.1.1.jar:/Users/xuyin/.ivy2/cache/org.apache.httpcomponents/httpclient/jars/httpclient-4.2.3.jar:/Users/xuyin/.ivy2/cache/org.apache.httpcomponents/httpcore/jars/httpcore-4.2.2.jar:/Users/xuyin/.ivy2/cache/commons-logging/commons-logging/jars/commons-logging-1.1.1.jar:/Users/xuyin/.ivy2/cache/com.fasterxml.jackson.core/jackson-annotations/jars/jackson-annotations-2.1.2.jar:/Users/xuyin/.ivy2/cache/junit/junit-dep/jars/junit-dep-4.10.jar:/Users/xuyin/.ivy2/cache/com.fasterxml.jackson.core/jackson-databind/jars/jackson-databind-2.1.2.jar:/Applications/IntelliJ IDEA 13 CE.app/lib/idea_rt.jar" org.jetbrains.plugins.scala.testingSupport.scalaTest.ScalaTestRunner -s com.umeng.push.apiserver.ApiServerServiceSpec -showProgressMessages true -C org.jetbrains.plugins.scala.testingSupport.scalaTest.ScalaTestReporter
Testing started at PM12:49 ...
Connected to the target VM, address: '127.0.0.1:50594', transport: 'socket'
Exception encountered when invoking run on a nested suite - java.net.BindException: Permission denied
java.lang.RuntimeException: java.net.BindException: Permission denied
at com.github.tomakehurst.wiremock.WireMockServer.start(WireMockServer.java:168)
at com.umeng.push.apiserver.ApiServerServiceSpec.beforeAll(ApiServerServiceSpec.scala:33)
at org.scalatest.BeforeAndAfterAll$class.beforeAll(BeforeAndAfterAll.scala:150)
at com.umeng.push.apiserver.ApiServerServiceSpec.beforeAll(ApiServerServiceSpec.scala:26)
at org.scalatest.BeforeAndAfterAll$class.run(BeforeAndAfterAll.scala:211)
at com.umeng.push.apiserver.ApiServerServiceSpec.run(ApiServerServiceSpec.scala:26)
at org.scalatest.tools.SuiteRunner.run(SuiteRunner.scala:60)
at org.scalatest.tools.Runner$$anonfun$doRunRunRunDaDoRunRun$3.apply(Runner.scala:1604)
at org.scalatest.tools.Runner$$anonfun$doRunRunRunDaDoRunRun$3.apply(Runner.scala:1601)
at scala.collection.immutable.List.foreach(List.scala:318)
at org.scalatest.tools.Runner$.doRunRunRunDaDoRunRun(Runner.scala:1601)
at org.scalatest.tools.Runner$$anonfun$runOptionallyWithPassFailReporter$2.apply(Runner.scala:705)
at org.scalatest.tools.Runner$$anonfun$runOptionallyWithPassFailReporter$2.apply(Runner.scala:704)
at org.scalatest.tools.Runner$.withClassLoaderAndDispatchReporter(Runner.scala:1645)
at org.scalatest.tools.Runner$.runOptionallyWithPassFailReporter(Runner.scala:703)
at org.scalatest.tools.Runner$.run(Runner.scala:592)
at org.scalatest.tools.Runner.run(Runner.scala)
at org.jetbrains.plugins.scala.testingSupport.scalaTest.ScalaTestRunner.runScalaTest1(ScalaTestRunner.java:213)
at org.jetbrains.plugins.scala.testingSupport.scalaTest.ScalaTestRunner.main(ScalaTestRunner.java:37)
Caused by: java.net.BindException: Permission denied
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:376)
at java.net.ServerSocket.bind(ServerSocket.java:376)
at java.net.ServerSocket.<init>(ServerSocket.java:237)
at java.net.ServerSocket.<init>(ServerSocket.java:181)
at org.mortbay.jetty.bio.SocketConnector.newServerSocket(SocketConnector.java:80)
at org.mortbay.jetty.bio.SocketConnector.open(SocketConnector.java:73)
at org.mortbay.jetty.AbstractConnector.doStart(AbstractConnector.java:283)
at org.mortbay.jetty.bio.SocketConnector.doStart(SocketConnector.java:147)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at org.mortbay.jetty.Server.doStart(Server.java:235)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at com.github.tomakehurst.wiremock.WireMockServer.start(WireMockServer.java:166)
... 18 more
Disconnected from the target VM, address: '127.0.0.1:50594', transport: 'socket'
Process finished with exit code 0
Jetty is probably trying to open a restricted port (like 80), and you are not running as root. Check the port number your test code is telling it to use (or it might be using a default).
I had a similar problem when I was using a USB surf stick for connecting to the internet, with some provider specific software to operate the surf stick. When disconnecting the stick (and thereby disconnecting from the internet), debugging worked fine for me. The stick software somehow messed up the routing of my computer, such that it tried to connect to localhost via the stick, which failed because the port number was blocked.
So, check if you have a similar configuration, and if it works when you turn off your internet connection.
Alternatively, this might also be a firewall issue. Try turning off your firewall for a while.
I strongly recommend disconnecting from the internet while your firewall is turned off!

JBoss 5.1 binds to host address while run in vserver with -b <guest address>

while starting JBoss 5.1.0.GA in virtual server machine on Debian (linux-VServer technology) I get the following error:
ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] (main) Error installing to Start: name=jboss.remoting:protocol=rmi,service=JMXConnectorServer state=Create mode=Manual requiredState=Installed
java.io.IOException: Cannot bind to URL [rmi://10.1.2.11:1090/jmxconnector]: javax.naming.NoPermissionException [Root exception is java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.AccessException: Registry.Registry.bind disallowed; origin /AA.BB.CC.DD is non-local host]
where AA.BB.CC.DD is host machine name, 10.1.2.11 is vserver guest with JBoss and JBoss is started with -b 10.1.2.11 (I also tried -Djboss.bind.address=10.1.2.11 - the same result).
10.1.2.11 is bound to dummy2 interface on host (serving 10.1.2.1 network).
The root exception is strange - why JBoss wants to bind to host address AA.BB.CC.DD? There were no problems with 4.2.3.GA on the same machine, also started with -b 10.1.2.11.
It starts correctly when no params present - binds to localhost and everything is ok, but it MUST be bound to 10.1.2.11 to be visible by Apache on another vserver guest, acting as proxy.
I thought that it can be fixed by setting net.ipv4.conf.all.promote_secondaries=1 via sysctl (was 0) but it didn't help much.
Has anyone had such problem?
Regards,
bart
Could you confirm if The port //10.1.2.11:1090/ isn't being used by another process (even a zombie one : P)?
There was a problem similar at JbossJIRA a couple of years ago... But i though it was already fixed.