Use raw IP to create a socket

Dear All,
Dear All
Given a raw IP number 126.124.35.41 and port number 1950,how to create a socket? i.e. how to use the following constructor to create a socket.
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

String HOST = "126.124.35.41";
int PORT = 1950;
//generate a InetAdress
InetAddress myAddress = InetAddress.getByName(HOST);
Socket s = new Socket(myAddress, PORT)
//or alternative
Socket s = new Socket(HOST, PORT)
Varli

Similar Messages

  • Error while reading raw file created in previous task using raw file destination

    I am reading a flat file and creating an raw file using raw file destination.  path of the raw file is in a variable.  now I am reading the raw file using the rawfile source component. I am able to execute if the .raw file is available.  But
    when we deploy into the production the .raw will be created runtime, so the package is getting failed while evualting the variable which hold the path of the variable.  since the .raw is not available i am not able to proceed further. it's in ssis 2008
    r2
    Error at Load Data [Raw File Source [401]]: File "c:\test123.raw" cannot be opened for reading. Error may occur when there are no privileges or the file is not found. Exact cause is reported in previous error message.
    Error at Load Data [SSIS.Pipeline]: component "Raw File Source" (401) failed validation and returned error code 0x80004005.
    Error at Load Data [SSIS.Pipeline]: One or more component failed validation.
    Error at Load Data : There were errors during task validation.

    I am also using a raw file destination using a variable.
    I have set DelayValidation = true on both the DataFlow task and even the Sequence Container.
    I get the same error when I run the entire ssis package, however
    when I run the individual container or individual task it runs without an error.
    Also, something interesting is the error is not the same path as the variable name.
    Warning: The system cannot find the file specified.
    Error: File "C:\Users\MyName\AppData\Local\Temp\GUIDNumber\\RawFileName" cannot be opened for reading. Error may occur when there are no privileges or the file is not found. Exact cause is reported in previous error message.
    The variable is "C:\Temp\ProjectName\RawFileName"
    I have other RawFile sources in this same project, but only this one file is giving me grief.
    Any other suggestions?  Is this a bug?
    Have you set an expression for connection string property of raw file? Is it based on variable/expression or configuration? If yes, check the value of variable/ expression or configuraton item at runtime by putting a breakpoint in the pre execute event of task
    and make sure path value its getting is correct. It may be that path is getting a different value at runtime due to expression/configuration set for it.
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Create tablespace using RAW device

    Hi,
    When you create the tablespace using RAW device, you no need to specify the size parameter in the sql. It works in Solaris but not in Linux.
    I dont know why, can anyone experience this issue before? please let me know
    Thanks
    Veera

    My advice for you would be to always include SIZE parameter when you create tablespace, redo log file on raw device.
    Best Regards
    Krystian Zieja / mob

  • How to use java to listen to a socket?

    i want to create a listener to monitor the input and output of a very socket,i don't know which classes can be used.
    thk u very much!!!!!!

    You can't create a socket in java to 'monitor the output'. At least not in the general sense.
    In the general sense this is usually referred to as raw sockets and the default java does not do that. You can however, do it via JNI. If that is what you had in mind then look at http://www.goto.info.waseda.ac.jp/~fujii/jpcap/index.html
    If this isn't what you are looking for then provide a bit more detail about what you will be monitoring.

  • Application hangs while trying to create a socket

    Hello,
    We have a third party application that makes HTTP connections using a old version of HTTPClient. Recently we have run into problems where the application hangs as one thread seems to hang while trying to create a socket (thread dumps show the hang occurs in native code) and other threads end up waiting for this thread as they need to obtain a lock on HTTPClient.HTTPConnection. We found out that HTTPClient was not setting a timeout on the underlying socket (SO_TIMEOUT) and the relevant patch has been implemented in the hope that if the condition arises again the offending thread will be timed out and allow other threads to try and continue.
    We will not be able to see if the patch works until Monday and I would like to understand the problem a little better if it fails. My question at what point will the socket timeout starting ticking? As our offending thread is waiting in native code is there a chance that the timeout will not be "active".
    Also can anyone provide reasons for an application hanging while trying to create a socket and any suggestions for monitoring or mitigating this problem?
    Thanks a lot.
    Sun Solaris 5.8
    JDK 1.4.1 b02

    It looks like our version of the JDK offer a connect method with a timeout value, I think this will do the trick.

  • SOAP unable to create a socket after OS upgrade OS/400 V5R4 to V7R1

    Hello,
    after we upgraded our OS from System i V5R4 to V7R1 we have problems with our SOAP adapters.
    In the runtime workbench and also in the SXMB_MONI the following error occured:
    SOAP: call failed: java.io.IOException: unable to create a socket
    Message-Verarbeitung fehlgeschlagen. Grund: com.sap.engine.interfaces.messaging.api.exception.MessagingException: java.io.IOException: unable to create a socket
    Before the OS upgrade the adapter rans without any errors and we tested the connection to the partner
    with an system running V5R4 with success. So it seems to be an error that came with the OS upgrade.
    Any idea? Had any one the same error after migration to V7R1? Thanks for your help.
    Best regards,
    Matthias

    Hello,
    we found out that the error is attached to DNS and Java stack. Our ABAP stack can set the url to the correct IP adress, if we configure a entry in SM59. Also the java stack calls our partner over SOAP with IP adress, but not with url. The urls are stored in the local host table, so we suppose that the java stack doesn't use the local dns table and doesn't ask our dns server for the right ip adress.
    Does anybody know this issue? The only change we did is upgrade OS/400 from V4R4 to V7R1. If a mod see this, I think it make sence to move this thread into the forum SAP on DB2 UDB for i5/OS (DB4). Thank's.
    Matthias

  • Creating a Socket to non-existent host very slow

    Why does it take a long time to try to create a Socket to a non-existent host on a Linux machine? On a Windows machine it takes approx. 20 sec., but when I try it on a Linux machine it takes approx. 180 sec.!
    Here's the code I'm using (very simple):
    import java.io.IOException;
    import java.net.Socket;
    import java.net.UnknownHostException;
    public class SocketCreator {
    public static void
    main(String[] args) {
    long _begin = System.currentTimeMillis();
    try {
    new Socket("10.10.10.10", 2000);
    } catch (UnknownHostException exception) {
    exception.printStackTrace();
    } catch (IOException exception) {
    exception.printStackTrace();
    long _end = System.currentTimeMillis();
    System.out.println("It took: " + (_end - _begin) + " ms.");
    Some additional info:
    - Java2 SDK 1.1.x, 1.3.x and 1.4.x
    - Windows XP
    - Red Hat 7.2, 9

    This is really a Linux system-wide problem. If you wanted to fix this in Java, you might even have to resort to JNI to sent yourself a signal and interrupt your system call (the system call is connect()).
    Unfortunately, the page give by "man tcp" on Linux is often not kept up-to-date with the many options available in /proc/sys/net/ipv4 .
    Also, access to the local LAN will often give a quick "No route to host" message.
    To test the long-timeout, you have to access a remote IP that does not exist. For instance, on Linux, if you start two xterms, and on the firxt you enter:
    telnet 66.120.89.14
    and on that second your enter
    netstat -an
    You will see something like this line:
    tcp 0 1 192.168.5.18:32836 66.120.89.14:23 SYN_SENT
    So now you know that the socket is sitting in SYN_SENT.
    Now, if you look on a nice, full man page of tcp, like
    http://www.die.net/doc/linux/man/man7/tcp.7.html
    You will see
    tcp_syn_retries
    The maximum number of times initial SYNs for an active TCP connection attempt will be retransmitted. This value should not be higher than 255. The default value is 5, which corresponds to approximately 180 seconds.
    Back on the second xterm, try:
    % cat /proc/sys/net/ipv4/tcp_syn_retries
    5
    I bet you got five also. You could turn it down to two (decreases time to around 20 seconds).
    You could try this as root:
    # sysctl -w net.ipv4.tcp_syn_retries=2
    or even add this command to your /etc/rc.d/rc.local file

  • Receiver SOAP channel error: Communication over HTTPS. Unable to create a socket

    Hi,
    I am getting following error while sending message from PI (7.1) to SalesForce system:
    'SOAP: call failed: java.io.IOException: Communication over HTTPS. Unable to create a socket'
    Scenario: Sending Customer data from SAP via Async proxy to PI which is sent further to SalesForce system via SOAP webservice call.
    When I am trying to Post data to the same webservice via SOAP UI it is working fine and data is getting updated in SalesForce system.
    XPI inspector logs for the channel suggest the following:
    client [103965] RequestImpl.initSslAttributes(): Initially sslAttributes = null
    client [103965] RequestImpl.initSslAttributes(): Cannot find SSL headers in the request.
    client [103965] RequestImpl.initSslAttributes(): No SSL attributes: not found in headers and not searched in FCA, because connection.isSecure() = false; sslAttributes = null
    I have checked the following SAP Note and requested for updation of SSL icm parameters
    891877 - Message-specific configuration of HTTP-Security
    I checked the following discussions:
    http://scn.sap.com/message/8910518#8910518
    http://scn.sap.com/message/6244674#6244674
    http://scn.sap.com/thread/2100000
    http://scn.sap.com/thread/1632114
    which are suggesting a different approach. Kindly suggest a way forward.
    Thanks,
    Vishwajeet

    This is related network issue.
    Did you do telnet in pi server with target system ip and port?
    If you use https then you need to install certificates.
    Check below threads
    http://scn.sap.com/thread/190299
    Unable to create socket error

  • DeliveryException: unable to create a socket

    Hi,
       We are using the Proxy-> XI -> SOAP scenario(Synchronus). I am able to see that the request message mapping has transformed the message in to the required format. But, when it is calling the SOAP adapter it is giving com.sap.aii.af.ra.ms.api.DeliveryException: unable to create a socket error. Can any one help us in knowing
    what exactly is the problem. We have used 'Do not use SOAP envelop' option in the SOAP receiver adapter.
    Thanks And Regards
    Sripathi G Yogesh

    hi,
    you can refer to thread for your issue
    Re: SOAP Adapter: java.io.IOException: unable to create a socket
    regards,
    ujjwal kumar

  • How to create a socket to send to URI?

    I have apache-axis2 accepting a WSDL on some uri <ipaddres:8080/my/service/uri>. I'm trying to have a Java program send a soap message to that URI. When I use the uri <ipaddress:8080> I can create a socket using
    new Socket( (InetAddress.getByName(ipaddress), port);But if I do something like
    String uri = "/my/service/uri";
    new Socket( (InetAddress.getByName(ipaddress+uri), port);I'll get an UnkownHostException. So how would I create a socket that can send to a given uri?

    I ended up trying to create an OutputStream from doing an http connection to the uri. I've tried
    OutputStream os = null;
    URL url = null;
    URLConnection conn = null;
    url = new URL("http://"+ipaddress+":"+port+path);
    conn = url.openConnection();
    conn.setDoOutput(true);
    conn.setDoInput(true);
    conn.setAllowUserInteraction(true);
    conn.setUseCaches(false);
    conn.connect();
    os = conn.getOutputStream();to write I use
    void send(byte[] b)
    os.write(b);
    os.flush();
    }The problem is, when I write to the outputstream, according to Wireshark, nothing gets sent across the wire.
    System.out.println("output stream ="+os+"."); gives me
    "output stream = ."
    which is very odd. I'd expect "output stream = null" or "output stream = <some object handle>." What could be preventing me from getting the output stream?

  • SOAP Receiver   java.io.IOException: unable to create a socket

    Hi All,
    I have scenario where i invoke a external webservice  (over internet)  using SOAP adapter. I can reach the external target as they see my traffic on firewall but i always get:
    com.sap.aii.af.ra.ms.api.DeliveryException: java.io.IOException: unable to create a socket
    I cannot find any logs which provide more information on this. I have imported all the clients certificates into my J2EE keystore (webservice is over HTTPS). Any suggestions on where better logs can be found would be appreciated. So far checked RWB and the default trace log.
    Since my certificates arent in ABAP stack I cant use SM59 to test. I have used test tool like soapUI and can invoke the web service (although on different network to my XI server) so not sure why XI is failing
    Any suggestions would be greatly appreciated!
    Sorry forgot to mention - The error its self i suspect is firewall and will need to get network people to look at but any information on how to debug errors like this on J2EE side would be appreciated - is there a J2EE version of SM59?
    Message was edited by:
            Chris Mills

    Hi Chris,
    Check this thread..
    SOAP Adapter: java.io.IOException: unable to create a socket
    cheers,
    Prashanth
    P.S Please mark helpful answers

  • SOAP Adapter: java.io.IOException: unable to create a socket

    Hi,
    I am trying to use the soap adapter to connect to a URL and post a document. When I try, the adapter throws the following
    java.io.IOException: unable to create a socket
    Does anyone know what causes this?
    I get it both with the SOAP Envelope turned on and off.
    I am trying to post to a URL that is usually used for straight HTTPS posts, could this cause an issue? The only reason we are using the SOAP adapter is to be able to send attachments! Hence, SOAP adapter, no SOAP envelope.
    Kind Regard,
    Chris

    Hi,
    Had faced the same issue. The possible reasons were :
    1. Either the target server might not be responding.
    2. The Target URL configured in the communication channel might be wrong.
    3. The port to which the message is being sent might not be opened which you need to cross-verify.
    For me the issue was the port, which wasn't enabled from our end. The messages went past successfully once it was enabled.
    Cheers!!
    Jithin James.

  • Mail sender Adapter error: unable to create a socket

    Hi,
    I got the following error in CC - mail adapter:
    exception caught during processing mail message; java.io.IOException: unable to create a socket
    both for pops and imaps protocols
    I could not find answers to how to fix it.Any help will be appreciated.
    Are there any other logs,trace to get more info about the error?
    Thank you.

    Hi Rinku,
    I checked the mail server url, acoount and password , if this was what you ment. I also read the wiki. It's a good one but describes simple pop and imap protocols.
    I still have the same error message and I am using  imaps and pops. I've read in forum post that  I need to to implement (import) "SAP Cryptographic toolkit" and import a certificate to ABAP and Java part of XI.
    Link: [Error in a Mail Adapter;
    Do you know how to do it? ( I am new to XI)
    Thank you for your help.
    Nataliya

  • Exception caught by adapter framework: unable to create a socket

    Hi All,
          I am using Idoc to XI To SOAP scinario. I got a alert asying that some messsage id is error. When i am trying to monitor that massage by taking help of the messgae id in the alert the message was successful in the SXMB_MONI,. Then i Went to message monitoring There the message statu was syetem error. Errror log is *Exception caught by adapter framework: unable to create a socket*. The communication channel was inactive wehere as the statsu of the channel was active in the directory... what is the reasonm for this error. and how to resilev this.

    As pointed already, a socket exception occurs when then message cannot pass the Firewall settings....there will be a port configured to send message to the SOAP receiver.....ask network guys to make relevant settings so that the port is free from Firewall restrictions.
    @Supriya --> Active/ Inactive status of the channel in ID and in CC monitoring are different things.
    To change the status of your CC in RWB --> Stop & Start your SOAP CC....the channel will remain inactive till no message is passed through it....once a message is passed the status will change to success/ error.
    You can also change the CC status to Automatic.
    Regards,
    Abhishek.

  • Creating a socket behind a proxy server

    How can I create a socket to a server if the client is behind a proxy server? I know java.net's HTTP-related classes have built-in proxy server support but this is not for a HTTP-based application.

    Hi,
    I also need to do this but not found any way yet. Somewhere I read that we can set the socket proxies (because mine was an application which tries to open socket connection over the network) through command line or by setting the system properties "socksProxyHost=<proxy_host_address>" and "socksPoxyPort=<proxy_port>". I tried to solve my proxy issue this way but all invain. While setting these system properties it is required that your proxy server is using the SOCKS service which I think is mostly the case but it still didn't work for me. You people try and c if it works for you. If anyhow you manage to get this issue resolved then please tell me also by posting a message.
    regards

Maybe you are looking for

  • Outgoing call log shows calls from my own number to the same number

    Every so often, I pick up the phone to dial out and get a fast busy tone.  I hang up, wait a few seconds, and try again, and I have dial tone and can dial out. I have not noticed any pattern or timeframes when this occurs. When looking at my online c

  • How to hide a Column

    Gurus Using XSL FO how can i hide a column based upon a value in XML file.Can you please guide Regards Nitin

  • Two iPhone Problems

    1. I loaded 4,500 photos on the iPhone, all the 2007 folder currently in iPhoto, and now when it syncs, it loads any additional photos from iPhoto. In case I want to bulk delete photos, how can that be done without deleting them in iPhoto and then re

  • Where to find System Restore physical disc replacemen​t?

    Alright so I got an older model Notebook/Tablet PC and Tried Windows 8 on it, since Win8 is really App Intense and set up for Touch Screen type interface and all that. Well... fingerprint reader and lots of other things simply don't work. Tried all t

  • How to stop firefox from switching to new tab?

    The issue I am dealing with is that I want Firefox to open all links in a new tab but not to switch to them automatically. I have checked all the settings in the Tools >> Options >> Tab menu and I have them all checked except for the last two. I am o