Javascript Socket Obj and Port 21

I'm just trying to open a socket connection to an ftp server
on port 21. I've read that people have had success over flex/flash,
but I haven't been able to connect to port 21 with Javascript and
there are no events or error messages associated with trying.
I'd just like to know if its currently possible.

Yes, you can use the Socket class to connect to an FTP server
in JavaScript:
var socket = new air.Socket("ftp.cs.berkeley.edu", 21);
socket.addEventListener(air.Event.CONNECT, connected);
socket.addEventListener(air.ProgressEvent.SOCKET_DATA,
dataHandler);
socket.addEventListener(air.IOErrorEvent.IO_ERROR,
errorHandler);
socket.addEventListener(air.SecurityErrorEvent.SECURITY_ERROR,
securityErrorHandler);

Similar Messages

  • Error establishing socket to host and port: EPM11:1433

    Hi Planning Experts,
    I am trying to configure EPM 11.1.2.1 (Planning)
    RDBMS: SQL server 2005 (Express Edition)
    OS: 2008 R2 x64
    i am getting error after providing RDBMS credentials "error establishing socket to host and port: EPM11:1433 Reson: connection refused: connect"
    Please help....
    Regards
    Kumar

    You may need to enable tcp/ip
    SQL Server Express listens on local named pipes and shared memory. With a default installation, you cannot remotely connect to SQL Server Express. You will need to enable TCP/IP and check if the firewall is enabled.
    To enable TCP/IP:
    From the Start menu, choose All Programs, point to Microsoft SQL Server 2005, point to Configuration Tools, and then click SQL Server Configuration Manager.
    Optionally, you can open Computer Manager by right-clicking My Computer and choosing Manage. In Computer Management, expand Services and Applications, expand SQL Server Configuration Manager.
    Expand SQL Server 2005 Network Configuration, and then click Protocols for InstanceName.
    In the list of protocols, right-click the protocol you want to enable, and then click Enable.
    The icon for the protocol will change to show that the protocol is enabled.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • Sockets and ports - routing messages between machines? helpppp!

    Hi,
    I'm new to java and am hoping someone out there can help me, hoping this is an ok place to post this:
    If all you need to create a connection is an IP address and a port number, using streams...
    Can you route messages from A to B then from B to C, where A looks up C through B having a hash table which contains C's IP address and port number?
    And how in the first instance does B know about A's IP address? All the examples I've seen the IP address is hard coded?
    Thanks in advance!

    I'm not sure what you are really trying to do... Can you explain in more concrete terms? Are you writing a chat client + server or something like that?

  • Sockets and ports - how to route through another machine?

    Hi,
    I'm hoping someone out there can help me:
    If all you need to create a connection is an IP address and a port number, using streams...
    Can you route messages from A to B then from B to C, where A looks up C through B having a hash table which contains C's IP address and port number?
    And how in the first instance does B know about A's IP address? All the examples I've seen the IP address is hard coded?
    Thanks in advance!

    Ok, so i mean I know this is possible, but I have some users who need to communicate with each other, sorta a message passing approach but with TCP rather than using JMS (time to do this in is v limited).
    They need to talk to a middle computer, whos job it is to lookup an appropriate partner to talk to, but:
    how do i go about getting the IP address in the first place so that they know who to talk to?
    Before communication can take place does there have to be some agreement in which they exchange IP addresses and port numbers?

  • Coherence::net::messaging::ConnectionException: could not establish a connection to one of the following addresses: {10.242.152.242/10.242.152.242:8088}; make sure the "remote-addresses" configuration element contains an address and port of a running TcpA

    Hi
    I have installed coheI have installed coherence server "fmw_12.1.3.0.0_coherence_Disk1_1of1.zip" along with Examples on windows machine and C++ client coherence-cpp-12.1.3.0.0b51709-windows-x86-vs2012.zip on the same machine.
    I have built the "contacts" C++ Example successfully and while I execute this "contacts" using run I am facing TcpAcceptor error.
    On my coherence server the TcpAcceptor is listening on port 8088, so I have modified the extend-cache-config.xml file with values "ip address of my windows machine" and port as "8088".
    All the time I am getting below error,
    coherence::net::messaging::ConnectionException: could not establish a connection to one of the following addresses: {10.242.152.242/10.242.152.242:8088}; make sure the "remote-addresses" configuration element contains an address and port of a running TcpAcceptor
        at class coherence::lang::TypedHandle<class coherence::component::net::extend::PofConnection> __thiscall coherence::component::util::TcpInitiator::openConne
    ction(void)(TcpInitiator.cpp:307)
        at coherence::component::util::TcpInitiator::openConnection
        at coherence::component::util::Initiator::ensureConnection
        at coherence::component::net::extend::RemoteCacheService::openChannel
        at coherence::component::net::extend::RemoteService::doStart
        at coherence::component::net::extend::RemoteService::start
        at coherence::component::util::SafeService::startService
        at coherence::component::util::SafeService::restartService
        at coherence::component::util::SafeService::ensureRunningServiceInternal
        at coherence::component::util::SafeService::start
        at coherence::net::DefaultConfigurableCacheFactory::configureService
        at coherence::net::DefaultConfigurableCacheFactory::ensureService
        at coherence::net::DefaultConfigurableCacheFactory::ensureRemoteCache
        at coherence::net::DefaultConfigurableCacheFactory::configureCache
        at coherence::net::DefaultConfigurableCacheFactory::ensureCache
        at coherence::net::CacheFactory::getCache
        at unsigned __int64 coherence::lang::class_spec<class coherence::lang::Managed<class ContactId>,class coherence::lang::extends<class coherence::lang::Object,class coherence::lang::Void<class coherence::lang::Object> >,class coherence::lang::implements<void,void,void,void,void,void,void,void,void,void,void,void,void,void,void,void> >::sizeOf(bool)
        at _onexit
        at class coherence::util::Hashtable * coherence::lang::factory<class coherence::util::Hashtable>::create(void)
        at class coherence::util::Hashtable * coherence::lang::factory<class coherence::util::Hashtable>::create(void)
        at BaseThreadInitThunk
        at RtlInitializeExceptionChain
        at RtlInitializeExceptionChain
        on thread "main"
    Caused by: coherence::net::messaging::ConnectionException: coherence::component::util::TcpInitiator::TcpConnection@029EAD78{Id=NULL, Open=1, LocalAddress=NULL,
    RemoteAddress=10.242.152.242/10.242.152.242:8088}: socket disconnect
        at class coherence::lang::TypedHandle<class coherence::net::messaging::Response> __thiscall coherence::component::net::extend::AbstractPofRequest::Status::g
    etResponse(void)(AbstractPofRequest.cpp:203)
        at coherence::component::net::extend::AbstractPofRequest::Status::getResponse
        at coherence::component::net::extend::AbstractPofRequest::Status::waitForResponse
        at coherence::component::util::Initiator::openConnection
        at coherence::component::net::extend::PofConnection::open
        at coherence::component::util::TcpInitiator::openConnection
        at coherence::component::util::Initiator::ensureConnection
        at coherence::component::net::extend::RemoteCacheService::openChannel
        at coherence::component::net::extend::RemoteService::doStart
        at coherence::component::net::extend::RemoteService::start
        at coherence::component::util::SafeService::startService
        at coherence::component::util::SafeService::restartService
        at coherence::component::util::SafeService::ensureRunningServiceInternal
        at coherence::component::util::SafeService::start
        at coherence::net::DefaultConfigurableCacheFactory::configureService
        at coherence::net::DefaultConfigurableCacheFactory::ensureService
        at coherence::net::DefaultConfigurableCacheFactory::ensureRemoteCache
        at coherence::net::DefaultConfigurableCacheFactory::configureCache
        at coherence::net::DefaultConfigurableCacheFactory::ensureCache
        at coherence::net::CacheFactory::getCache
        at unsigned __int64 coherence::lang::class_spec<class coherence::lang::Managed<class ContactId>,class coherence::lang::extends<class coherence::lang::Object
    ,class coherence::lang::Void<class coherence::lang::Object> >,class coherence::lang::implements<void,void,void,void,void,void,void,void,void,void,void,void,void
    ,void,void,void> >::sizeOf(bool)
        at _onexit
        at class coherence::util::Hashtable * coherence::lang::factory<class coherence::util::Hashtable>::create(void)
        at class coherence::util::Hashtable * coherence::lang::factory<class coherence::util::Hashtable>::create(void)
        at BaseThreadInitThunk
        at RtlInitializeExceptionChain
        at RtlInitializeExceptionChain
        on thread "main"
    Caused by: coherence::io::IOException: socket disconnect
        at unsigned int __thiscall coherence::net::Socket::readInternal(unsigned char *,unsigned int)(Socket.cpp:333)
        at coherence::net::Socket::readInternal
        at coherence::net::Socket::SocketInput::read
        at coherence::io::BufferedInputStream::fillBuffer
        at coherence::io::BufferedInputStream::read
        at coherence::component::util::TcpInitiator::readMessageLength
        at coherence::component::util::TcpInitiator::TcpConnection::TcpReader::onNotify
        at coherence::component::util::Daemon::run
        at coherence::lang::Thread::run
        on thread "ExtendTcpCacheService:coherence::component::util::TcpInitiator:coherence::component::util::TcpInitiator::TcpConnection::TcpReader"

    We are facing same issue.    Could you please provide us any working .Net sample code for the version 12.1.2.0.
    <ssl>
                  <protocol>Tls</protocol>
                  <local-certificates>
                    <certificate>
                      <url>c:\Cert\</url>
                      <password>password</password>
                      <flags>DefaultKeySet</flags>
                    </certificate>
                  </local-certificates>
                </ssl>
    thanks
    Bala

  • Socket connection - Available Port Numbers

    Hi,
    I am trying to connect to a server running on Unix through my NT client. This is being done via socket connection and by supplying IP Address of the machine plus the port number.
    My server is running on Unix, Solaris 8, Ultra 5 machine. I want to know if there is some allowable range of Port Numbers on the Unix machine?
    Or is it that I can use any number starting from 1 to infinite as my port number?
    Thanks.

    The ports below 1024 are reserver for only the "root" user and 65536 is usually the max port
    number available. Ports below 1024 are also reserved for a user in the Administrators group on NT and W2K.
    Actually, the maximum port number is 65535 since IPv4 port numbers are 16 bit quantities and that is the maximum value of a 16 bit quantity.

  • Access "Host"  and port information

    Hi,
    Is there a way to access host name and port number (http://<servername>:<port>) programmatically.
    Regards,
    Naveen

    Hi Naveen,
    The portal sets a cookie on the user's desktop that includes a number that corresponds to the physical portal server that you're connected to and the portal server node. The name of this cookie is saplb_*. One way to examine the value of this cookie is to log into the portal and then type the following command in your address line:
    javascript:alert(document.cookie);
    This will cause a box to pop up containing a list of your cookies. The value of your saplb_* cookie will look something like this:
    saplb_*=(J2EE1233000)1233050;
    The number that you want is after the end parenthesis. In other words, you want 1233050. Now, navigate to:
    Java Developer -> Portal Archive Deployer & Remover
    Look in the 'Cluster Administration' area. This section contains Server ID, Server Name, Server Type, and Server IP. Look for your 1233050 number in the Server ID area, and then find that line's corresponding IP Address. You then do an NSLookup with that IP Address and there you will have your hostname.
    From what I understand, all of the data in that Cluster Administration page is static. In other words, it will not change. I have made a jsp to grab that cookie's value and then translate that into the hostname. I've hardcoded the data from the Cluster Administration page into my jsp. Also, this data did not change after we upgraded from EP6 to EP7.
    I hope this helps!
    -StephenS

  • Passing data to IP address and PORT???

    Hi,
    I am trying to do a scenario, where in I need to make a synchronous call to a IP address and Port.
    The scenarion is
    SAP--> XI --> IP address/Port.
    Has anyone done this scenario, wherin you pass the string of data to a IP address and port?
    Regards

    The scenario is RFC --> SAP XI --> IP address/port.
    We have to give the bank related data to an IP address and a port for which we have to do a socket level programming.
    Its a synchronous call.
    We are thinking of using JAVA proxies for the same. But the receiver side JAVA proxies have to sit on XI server?
    Can we have receiver side proxies on SAP XI server and make a call to IP address and Port?
    Can the .ear file be deployed on the XI server??
    Thanks

  • Finding out the source ip and port of an incoming Upacket

    Hi, does anybody know how to find out the source ip address and port of a udp packet coming into an rtp session based on a NewParticipantEvent or a NewReceivedStreamEvent? I would really appreciate any reply...
    thanks

    The only proper solution is the one pointed out by ejp :
    1) Accept new connection with ServerSocket, store the newly created Socket in a collection of some sort.
    2) Map the collection in a way that's suitable to your application. Then when you need to send something to client X you simply look up which Socket instance has been accepted/created for said client and use the in/out streams to transfer data.

  • Given raw IP and port number,create a scoket.

    Dear All,
    Given a raw IP number 126.124.35.41 and port number 1950,how to create a socket? I am going to use
    Socket s = new Socket(InetAddress address, int port)
    I know the key is to use raw IP to create a InetAddress. But how?
    Thanks a lot.
    Kevin

    By the way, if you like to get InetAddress, you can do it by
    InetAddress address= InetAddress.getByName("126.124.35.41");

  • Comunication question for socket server and socket client

    I created a simple socket server and a socket client
    The server receive request from server and send same request back to the client.
    Please see example code as below:
    package socket;
    import java.net.*;
    import java.io.*;
    public class SimpleServer {
    public SimpleServer(int listen_port) {
    this.listen_port = listen_port;
    public static void main(String[] args) {
    SimpleServer server = new SimpleServer(4444);
    server.acceptConnections();
    public void acceptConnections() {
    try {
    ServerSocket server = new ServerSocket(listen_port);
    Socket incomingConnection = null;
    while (true) {
    incomingConnection = server.accept();
    handleConnection(incomingConnection);
    } catch (BindException e) {
    System.out.println("Unable to bind to port " + listen_port);
    } catch (IOException e) {
    System.out.println("Unable to instantiate a ServerSocket on port: " + listen_port);
    public void handleConnection(Socket incomingConnection) {
    try {
    InputStream inputFromSocket = incomingConnection.getInputStream();
    BufferedReader streamReader = new BufferedReader(new InputStreamReader(inputFromSocket));
    PrintWriter streamWriter = new PrintWriter(incomingConnection.getOutputStream());
    StringBuffer sb = new StringBuffer();
    String line = null;
    int i = 0;
    while((line=streamReader.readLine())!=null){
    streamWriter.println(line);
    break;
    streamWriter.close();
    streamReader.close();
    incomingConnection.close();
    } catch (Exception e) {
    protected int listen_port;
    //socket client
    package socket;
    import java.io.*;
    import java.net.*;
    import java.util.Iterator;
    import java.util.List;
    import java.math.*;
    public class Simple {
    public Simple(String host_ip, int host_port) {
    this.host_ip = host_ip;
    this.host_port = host_port;
    public static void main(String[] args) {
    Simple simple = new Simple("192.168.254.134", 4444);
    simple.setUpConnection();
    try {
    String result = simple.getResponse("This is first request");
    String result2 = simple.getResponse("This is second request");
    simple.tearDownConnection();
    catch (Exception e) {
    System.out.println("error");
    e.printStackTrace();
    public void setUpConnection() {
    try {
    // Create new socket object
    Socket client = new Socket(host_ip, host_port);
    socketReader = new BufferedReader(new InputStreamReader(client.
    getInputStream()));
    socketWriter = new PrintWriter(client.getOutputStream());
    } catch (UnknownHostException e) {
    System.out.println(
    "Error setting up socket connection: unknown host at " +
    host_ip + ":" + host_port);
    catch (IOException e) {
    System.out.println("Error setting up socket connection: " + e);
    public String getResponse(String request) {
    StringBuffer fileLines = new StringBuffer();
    try {
    socketWriter.println(request);
    socketWriter.flush();
    String line = null;
    int i = 0;
    int chars = 0;
    int sizeOfBuffer = 100;
    char[] cbuf = new char[sizeOfBuffer];
    while ( (chars = socketReader.read(cbuf)) >= 0) {
    fileLines.append(cbuf, 0, chars);
    } catch (Exception e) {
    e.printStackTrace();
    return fileLines.toString();
    public void tearDownConnection() {
    try {
    socketWriter.close();
    socketReader.close();
    } catch (IOException e) {
    System.out.println("Error tearing down socket connection: " + e);
    protected BufferedReader socketReader;
    protected PrintWriter socketWriter;
    protected String host_ip;
    protected int host_port;
    I send two request at the same time.
    Please see code in main method of Simple class
    String result = simple.getResponse("first");
    String result2 = simple.getResponse("second");
    What I think is the socket server will send the same request back to the client.
    So value of result and result2 should be 'first' and 'second'
    But it always return empty String for result2.
    What's the problem?
    Thanks for your help

    Your code has a couple of problems.
    1) the server doesn't flush its socket, so nothing will actually be sent until the socket is closed.
    2) the client getResponse() reads until end of file, so an attempt to use it a second time will fail
    3) in a real application the server should use threads. See the echo server I posted in http://forum.java.sun.com/thread.jsp?forum=11&thread=526980 reply 3.
    Also, please use the [code]  tags when posting source. The lack of these is probaly why you haven't had any repiles until now.

  • STUN server ipaddress and ports

    Hi This is Ramesh i have downloaded the STUN server source code.
    while running iam getting the following exception.how i can use the stun server for streaming server.
    the stun server taking two ips and two ports any one knows which ips and ports i need to use.
    iam developing a video conferencing application so that iam trying to use stun as a streaming server bez it will under NAT and Firewall also.
    D:\project\jstun\src>java de.javawi.jstun.test.demo.StunServer 42050 192.168.0.11 42052 192.168.0.33
    java.net.BindException: Cannot assign requested address: Cannot bind
    at java.net.PlainDatagramSocketImpl.bind0(Native Method)
    at java.net.PlainDatagramSocketImpl.bind(Unknown Source)
    at java.net.DatagramSocket.bind(Unknown Source)
    at java.net.DatagramSocket.<init>(Unknown Source)
    at java.net.DatagramSocket.<init>(Unknown Source)
    at de.javawi.jstun.test.demo.StunServer.<init>(StunServer.java:46)
    at de.javawi.jstun.test.demo.StunServer.main(StunServer.java:241)
    i have tried with public ip also like 121.246.235.202 with this my server is running.
    please give me a valid solution how to use stun server as a streaming server.
    or
    in order to transmit video over internet what should i do.
    if u have any code please send me.

    mmm it's a port mistake... try to check if the port number you wanna use is free on your system.
    the bind operation is when an application try to put a socket in listening on the port u specified. this means that if the port is busy or dedicated to another process a bind exception is gonna ti be rise.
    try to change the port number.
    do few tests disabling system firewall or giving enough right to the application.
    have fun ^^

  • Visual Voicemail gone after upgrade to 2.0 (and porting number)

    Anyone else experience this? I upgraded to 2.0 and at the same time I ported the old iPhone to another cell phone number on my account with ATT. The upgrade to 2.0 and porting appeared to go OK as everything else is working EXCEPT when on the phone application, I can not get the visual voicemail button to do anything. I press it and it acts like it is taking some time to open but it never brings up the visual voicemail screen. The phone part works as usual in all other ways.

    I upgraded to the pre-release version of 2.0 and it worked fine. Then this morning i tried to update to the official 2.0 and it could not connect to iTunes, and that pinwheel kept spinning. So I pressed home button and power button until it (iPhone) rebooted. Then i connected it to iTunes and it asked me to restore.... So i pressed the option key (in mac, idk what it is in windows) and selected the prerelease version to downgrade to and now its fine. So...... good luck all

  • How to determine which IP address and port is used to make DNS queries?

    I am using JNDI/DNS API to query a Enum server (Tel URI resolution in VOIP world) what is a DNS server.
    But I have many network interfaces, in a VLAN environment, and I must to specify from which interface (and port)
    all the requests are sent.
    When I read the code of JNDI/DNS API (in JDK 1.5) and specially the DNSClient class, I can see that the
    DatagramSocket is created without parameters... : udpSocket = new DatagramSocket();
    How can I specify the IP address and port to use for my client???
    Thanks for your help.

    I must to specify from which interface (and port) all the requests are sent. You don't have to specify the interface unless your static unicast routing tables are incorrect, and you never have to specify the port unless some lunatic is in control of your firewall.

  • FF keeps defaulting to the wrong HTTP proxy server and port. I have to change it every time I attempt to open Firefox? How do I change it for good?

    The manual proxy settings keep defaulting to the wrong HTTP and port. This has caused me many hours of anguish. It works fine when I correct the settings but after you log off and then come back it has to be changed again. Is there anyway to fix it? Or can I go back to the previous version because 4 definitely has some issues (other than this one). I could live with it if I had to but I'm not the only one who uses this computer and they don't know how to make the changes. Thanks and I would definitely appreciate an answer.

    See:
    * http://kb.mozillazine.org/Preferences_not_saved
    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    * Don't make any changes on the Safe mode start window.
    * https://support.mozilla.com/kb/Safe+Mode
    * https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes

Maybe you are looking for

  • How do I get my iphone 4 to open safari for the internet to work?

    any sugestions will be gladly appreciated!

  • Draft email copied content from one and sent in other

    I have an employee here who had 2 drafts, both were replys to different emails with different subjects and different recipients. After completing one of the emails, they pressed send and that was that. After getting back to the office, they noticed i

  • Using Content Engine for SOCKS Proxy

    We have a CE566 integrated with an ICAP server in a proxy role for our network. we are experiencing issues with a Java applet that many of our users use with an outside vendor. Here are the test results from Sun's Java J2RE development team who we're

  • Cancel a pending payment

    Hello, Could you please cancel my 3 pending payments? I tried twice to buy credit with my smart phone and it did not work. I then tried with my computer, and it worked.  I do not need 40€ credit. Thanks in advance for your help, Best regards, Emilie

  • IOS mail showing garbled headers

    Hi, When I receive e-mails on my iPad from e.g. Gmail, and the sender has a name configured with non-standard characters like "André" or "König", mail shows garbage in the From: field. It doesn't happen if such an address is in the Cc field. All othe