Send String failed using socket

Hi all,
I have just finished a program which send a string client to the host server using simple socket. The program is developed using JBuilder9 and run well in winxp pro. When the same program run in linux (red hat), the host server can only see the connection and close. The string never receive in the server side. The problem is worked out like the following
-create socket
-create output stream using "PrintWriter"
-send string
-close socket
Pls. comment on what I should do to debug this problem.
Thanks,
Peter

Hi all,
Thanks for your assistance. I have log down the following from linux using "tcpdump"
13:16:48.218624 128.128.2.161.33083 > pmon-srv0.999: P 1:42(41) ack 1 win 5840 <nop,nop,timestamp 158365 0> (DF)
13:16:48.219105 128.128.2.161.33083 > pmon-srv0.999: F 42:42(0) ack 1 win 5840 <nop,nop,timestamp 158365 0> (DF)
13:16:48.219742 pmon-srv0.999 > 128.128.2.161.33083: . ack 43 win 64199 <nop,nop,timestamp 2471694 158365> (DF)
13:16:48.219876 pmon-srv0.999 > 128.128.2.161.33083: F 1:1(0) ack 43 win 64199 <nop,nop,timestamp 2471694 158365> (DF)
13:16:48.219894 128.128.2.161.33083 > pmon-srv0.999: . ack 2 win 5840 <nop,nop,timestamp 158365 2471694> (DF)
13:17:59.746088 128.128.2.211.1633 > pmon-srv0.999: P 1:43(42) ack 1 win 17520 (DF)
13:17:59.756047 128.128.2.211.1633 > pmon-srv0.999: F 43:43(0) ack 1 win 17520 (DF)
13:17:59.756493 pmon-srv0.999 > 128.128.2.211.1633: . ack 44 win 64198 (DF)
13:17:59.756989 pmon-srv0.999 > 128.128.2.211.1633: F 1:1(0) ack 44 win 64198 (DF)
13:17:59.757103 128.128.2.211.1633 > pmon-srv0.999: . ack 2 win 17520 (DF)
128.128.2.211 is the client in winxp pro
128.128.2.161 is the client in linux
pmon-srv is the server
In the first line of each section, it shows that number of bytes have push to the server. I don't know what should I do next to solve the problem.
Here is the source code
public class pconnect {
String ip_addr;
String fromServer, toServer;
int i,port;
Socket pmSocket;
BufferedReader pm_in;
PrintWriter pm_out;
public pconnect(String ip, int portno) {
ip_addr=ip;
port=portno;
try {
pmSocket = new Socket(ip_addr, port);
pm_out = new PrintWriter( pmSocket.getOutputStream(), true );
pm_in = new BufferedReader( new InputStreamReader( pmSocket.getInputStream() ) );
} catch (Exception err) {
System.err.println(err);
System.exit(0);
public void sendMsg(String msg) {
try {
Thread.sleep(5000);
} catch (InterruptedException e){}
if (pmSocket.isConnected()) {
try {
System.out.println("Stream Status: " + pmSocket.isOutputShutdown());
System.out.println("Bound Status: " + pmSocket.isBound());
pm_out.println(msg);
if (pm_out.checkError()) {
System.out.println("Socket error");
}catch (Exception e){System.out.println("Exception: " + e);}
try {
pmSocket.close();
} catch (Exception err) {
System.err.println("Closed Error: "+err);
public static void main(String[] args) {
System.out.println(args.length);
System.out.println(args[0]);
pconnect pconnect1 = new pconnect(args[0],Integer.parseInt(args[1]));
pconnect1.sendMsg("SET00000000N|ALARM:MBX TEST|c29K1920755D");
Thanks,
Peter

Similar Messages

  • How to send string data through socket!

    Is there any method to send string data over socket.
    and if client send string data to server,
    How to get that data in server?
    Comments please!

    Thank for your kind answer, stoopidboi.
    I solved the ploblem. ^^;
    I open the source code ^^; wow~~~~~!
    It will useful to many people. I spend almost 3 days to solve this problem.
    The program works like this.
    Client side // string data ------------------------> Server side // saving file
    To
    < Server Side >
    * Server.java
    * Auther : [email protected]
    import java.io.*;
    import java.net.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class Server extends JFrame
         private JTextField enter;
         private JTextArea display;
         ObjectInputStream input;
         DataOutputStream output;
         FileOutputStream resultFile;
         DataInputStream inputd;
         public Server(){
              super("Server");
              Container c = getContentPane();
              enter = new JTextField();
              enter.setEnabled(false);
              enter.addActionListener(
                   new ActionListener(){
                        public void actionPerformed(ActionEvent ev){
                             //None
              c.add(enter, BorderLayout.NORTH);
              display = new JTextArea();
              c.add(new JScrollPane(display),
                     BorderLayout.CENTER);
              setSize(300, 150);
              show();
         public void runServer(){
              ServerSocket server;
              Socket connection;
              int counter = 1;
              display.setText("");
              try{
                   server = new ServerSocket(8800, 100);
                   while(true){
                        display.append("Waiting for connection\n");
                        connection = server.accept();
                        display.append( counter + " connection is ok.\n");
                        display.append("Connection " + counter +
                             "received from: " + connection.getInetAddress().getHostName());
                        resultFile = new FileOutputStream("hi.txt");
                        output = new DataOutputStream(resultFile);
                        output.flush();
                        inputd = new DataInputStream(
                             connection.getInputStream()
                        display.append("\nGod I/O stream, I/O is opened\n");
                        enter.setEnabled(true);
                        try{
                             while(true){
                                  output.write(inputd.readByte());
                        catch(NullPointerException e){
                             display.append("Null pointer Exception");
                        catch(IOException e){
                             display.append("\nIOException Occured!");
                        if(resultFile != null){
                             resultFile.flush();
                             resultFile.close();
                        display.append("\nUser Terminate connection");
                        enter.setEnabled(false);
                        resultFile.close();
                        inputd.close();
                        output.close();
                        connection.close();
                        ++counter;
              catch(EOFException eof){
                   System.out.println("Client Terminate Connection");
              catch(IOException io){
                   io.printStackTrace();
              display.append("File is created!");
         public static void main(String[] args){
              Server app = new Server();
              app.addWindowListener(
                   new WindowAdapter(){
                        public void windowClosing(WindowEvent e){
                             System.exit(0);
              app.runServer();
    < Client side >
    * Client.java
    * Auther : [email protected]
    package Client;
    import java.io.*;
    import java.net.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class Client extends JFrame
         private JTextField enter;
         private JTextArea display;
         DataOutputStream output;
         String message = "";
         public Client(){
              super("Client");
              Container c = getContentPane();
              enter = new JTextField();
              enter.setEnabled(false);
              enter.addActionListener(
                   new ActionListener(){
                        public void actionPerformed(ActionEvent e){
                             //None
              c.add(enter, BorderLayout.NORTH);
              display = new JTextArea();
              c.add(new JScrollPane(display), BorderLayout.CENTER);
              message = message + "TT0102LO12312OB23423PO2323123423423423423" +
                        "MO234234LS2423346234LM2342341234ME23423423RQ12313123213" +
                        "SR234234234234IU234234234234OR12312312WQ123123123XD1231232" +
                   "Addednewlinehere\nwowowowwoww";
              setSize(300, 150);
              show();
         public void runClient(){
              Socket client;
              try{
                   display.setText("Attemption Connection...\n");
                   client = new Socket(InetAddress.getByName("127.0.0.1"), 8800);
                   display.append("Connected to : = " +
                          client.getInetAddress().getHostName());
                   output = new DataOutputStream(
                        client.getOutputStream()
                   output.flush();
                   display.append("\nGot I/O Stream, Stream is opened!\n");
                   enter.setEnabled(true);
                   try{
                        output.writeBytes(message);
                   catch(IOException ev){
                        display.append("\nIOException occured!\n");
                   if(output != null) output.flush();
                   display.append("Closing connection.\n");
                   output.close();
                   client.close();
              catch(IOException ioe){
                   ioe.printStackTrace();
         public static void main(String[] args){
              Client app = new Client();
              app.addWindowListener(
                   new WindowAdapter(){
                        public void windowClosing(WindowEvent e){
                             System.exit(0);
              app.runClient();

  • Sending an image using sockets

    can anybody give an idea about how to send an image using sockets.....
    what i want to do is a client that connects to a server this server has the images...so the client request any image that the server has and display it int the client's frame

    Very good point! The problem ( I told you it was untested!) with the above is that the Image class isn't actually serialisable.
    The solution depends on how you're storing your images and how you're managing them within your server. It also depends on your proposed client. For example, if your client was a browser and your images files on a disk, then you might use:
                        Socket s;
                        // Write out header
                        PrintWriter pw = new PrintWriter(s.getOutputStream());
                        pw.println("Content-Type: image/gif");
                        // And send out data.
                        byte[] buffer = new byte[2048];
                        int count;
                        while((count = fis.read(buffer))>0) {
                             s.getOutputStream().write(buffer, 0, count);
                        s.getOutputStream().close();
                   }although you'd probably be better off using a proper webserver. If you're using a proprietry client, then you can either use Swing's JEditorPane to act like browser and display the image as the server above presents it.
    Otherwise, your client could use the incoming byte stream to create a BufferedImage instance.
    How are you storing your images and how are you presenting them?

  • Help: send unicode text using sockets

    Hi,
    I am trying to send unicode text to a native app using sockets. My test code looks like this
    Socket socket = new Socket(m_serverHost, m_hostPort);
    OutputStreamWriter out = new OutputStreamWriter(socket.getOutputStream(), "UTF-8");
    InputStreamReader reader = new InputStreamReader(socket.getInputStream(), "UTF-8");
    BufferedReader in = new BufferedReader(reader);
    // receive response to connect
    byte[] rc = new byte[4];
    int i = 0;
    while (i < 4)
    rc[i++] = (byte) in.read();
    String text = new String("Hello");
    out.write(text);
    // receive response to "hello"
    i = 0;
    while (i < 4)
    rc[i++] = (byte) in.read();
    My test program is connecting to the server socket but the server does not seem to understand the text that I send.
    Please comment if I am doing anything wrong or advice if you have any different ideas.
    Thanks,
    nallamos

    Try using the following output and input streams.
    out = new DataOutputStream(
    new BufferedOutputStream(
    s.getOutputStream()));
    in = new DataInputStream(
    new BufferedInputStream(
    s.getInputStream()));
    When you send the data send it using
    out.WriteBytes(message)

  • Drawing for text and string fails using X server(xsun) xlib

    Hi all,
    I have sparc system and Iam using xsun on solaris 10 and ps -ef | grep
    -i xsun gives this:
    /usr/openwin/bin/Xsun :0 nkeyboard nmouse -dev vfb -dev vfb screen 0
    1028x102
    Now I am trying to use XDrawString and XDrawText for simple one
    character drawing but to no avail as these calls don't generate
    anything. All line generation and bitmap are rendered correctly on the
    virtual frame buffer to generate a tiff file.
    The same set of calls are working great on sun 2.6.
    What can be the problem? I can't seem to find any solution to that?
    ////////////////////// These calls fail completely returnig
    0 ////////////////////////////////////
    CR_CHAR Temp[2];
    Temp[1] = 0;
    Temp[0] = textString;
    int rt = XDrawString(_CRDisplay, *pagePixmap, CRGC, xPos, yPos, Temp,
    1);
    XTextItem item;
    item.chars = Temp;
    item.nchars = 1;
    item.delta = 0;
    item.font = 0;
    int rt = XDrawText(_CRDisplay, *pagePixmap, CRGC, xPos, yPos, &item,
    1);
    Regards,
    RUI

    Partial Solution Found
    I used the method below to boot single-user from GRUB.
    <URL:http://docs.sun.com/app/docs/doc/817-1985/>
    Solaris 10 System Administrator Collection >>
    System Administration Guide: Basic Administration >>
    11. x86: GRUB Based Booting (Tasks) >>
    x86: Booting a System in the GRUB Based Boot Environment >>
    x86: How to Boot a System to Run Level S (Single-User Level)
    Now I can login as root in single-user level.
    I installed NVIDIA-Solaris-x86-169.12.run driver file successfully.
    I used the /usr/X11/bin/xorgconfig command to create a basic xorg.conf
    file. After reboot it locked up when I tried to start the graphics login.
    From what I have read I need to use kdmconfig to change from Xsun
    server to Xorg server but when I try to run the command kdmconfig I
    get the message kdmconfig not found.
    New Questions:
    1. Where is kdmconfig located and how do I start kdmconfig?
    2. Is there some other method to change from Xsun server to Xorg server?
    3. In single-user level what command do I use to startx?
    Thanks in advance,
    Ken

  • How to use Sockets to send/recieve Strings in XML form?

    Hello there to everyone reading my Post !
    I am entering a total new subject in my learning about Java Programming, where I will need to interact with a server, I was wondering If somebody could help me with a Question I have; here it is:
    A server provided me a Socket, (and that is of course an IP address and a Port), And I am supposed to connect to that server using a Java program that connects to servers using a Socket class, then I am supposed to send a String representing a valid XML, and then the server replies me With another String representing a valid XML which I am supposed to store in a String type.
    Is this exact write/read operation possible? If so, could someone please give me some code samples to solve this problem?
    PD: The server Does this operation only: recieve/send Strings. as its called transactional switch.

    Hi ejp, thank you very much for the quickest of replies.
    I am wondering If could you please give me a more detailed source code sample, and the reasons are:
    Well, first I am a newbie. and secondly, and most importantly, I actually can try to send the String that represents the XML, but then...
    I don't have any idea about how to know when my program has finished sending the String. and therefore I wouldn't know where to put the lines of code that start reading the corresponding response String.
    Could you please help me out?
    PD: I've been using DOM to read XMLs. Does DOM Objects also allow to read/write XMLs using Sockets?
    Thanks in advance!

  • Sending file using sockets (difficult)

    Hi, i have the following section of code
    (of which i am not claiming ownership) which
    implements a DCC Send command from irc.
    It accomplishes this using sockets, and while
    i understand how the code accomplishes what it
    does, i need help with a possible modification.
    Basically what i am looking to do is keep track
    of the progress of the send - so that the
    user can at any time see how much of the file
    has been sent and how much is remaining.
    If anyone has done such a thing in the past or
    has a good idea as to how this should be implemented,
    i would be greatful for their help.
    Here is the code:
    new Thread() {
                public void run() {
                    try {
                        ServerSocket ss = new ServerSocket(0);
                        ss.setSoTimeout(timeout);
                        int port = ss.getLocalPort();
                        //byte[] ip = ss.getInetAddress().getAddress();
                        byte[] ip = InetAddress.getLocalHost().getAddress();
                        long ipNum = 0;
                        long multiplier = 1;
                        for (int i = 3; i >= 0; i--) {
                            int byteVal = (ip[i] + 256) % 256;
                            ipNum += byteVal*multiplier;
                            multiplier *= 256;
                        // Rename the filename so it has no whitespace in it when we send it.
                        // .... I really should do this a bit more nicely at some point ....
                        String safeFilename = file.getName().replace(' ', '_');
                        safeFilename = safeFilename.replace('\t', '_');
                        // Send the message to the user, telling them where to connect to in order to get the file.
                        sendCTCPCommand(nick, "DCC SEND " + safeFilename + " " + ipNum + " " + port + " " + file.length());
                        // The client may now connect to us and download the file.
                        Socket socket = ss.accept();
                        socket.setSoTimeout(30000);
                        // Might as well close the server socket now; it's finished with.
                        ss.close();
                        BufferedOutputStream output = new BufferedOutputStream(socket.getOutputStream());
                        BufferedInputStream input = new BufferedInputStream(socket.getInputStream());
                        BufferedInputStream finput = new BufferedInputStream(new FileInputStream(file));
                        byte[] outBuffer = new byte[bufferSize];
                        byte[] inBuffer = new byte[4];
                        int bytesRead = 0;
                        while ((bytesRead = finput.read(outBuffer, 0, outBuffer.length)) != -1) {
                            output.write(outBuffer, 0, bytesRead);
                            output.flush();
                            input.read(inBuffer, 0, inBuffer.length);
                        output.close();
                        input.close();
                        log("+++ DCC SEND Completed to " + nick + " (" + file.getPath() + ")");
                    }

    You already have the necessary code to find the number of bytes sent at any point during the transmission. You can find out the size of the file by instantiating a RandomAccessFile before you send it, and querying for the file length.
    I suggest you make the file size and bytes sent volatile and conveniently accessible to another thread (best implemented here as an inner class?). Your new thread will need to monitor the file transfer at intervals to update the progress indicator. You can generate estimates of time remaining by measuring the average transmission rate, and extrapolating using the total file size. Classically this is done using an average, but you might be better just maintaining a list of fairly recent samples, allowing for the speed swings inherent in internet connections.
    How you update the progress indicator from your monitor thread is up to you. I suggest exposing methods in the UI for setting the progress and time remaining, and simply update them from the monitor.
    Does this help any?

  • Send html page (with images) using sockets

    I am trying to implement http and am coding this using sockets. So it is a simple client-server set up where the browser queries my server for a webpage and it should be shown. The html itself is fine, but I can't get any of the images to show up! All of my messages give me a status "200 OK" for the images, so I cant understand what my problem is!
    Also, is the status and header lines supposed to be shown in the browser? I didnt think so but it keeps showing up when I query a webpage.
    Please help!
    import java.io.* ;
    import java.net.* ;
    import java.util.* ;
    public final class WebServer
         public static void main(String argv[]) throws Exception
              // Set the port number.
              int port = 8888;
              // Establish the listen socket.
              ServerSocket ssocket = new ServerSocket(port);
              // Establish client socket
              Socket csocket = null;
              // Process HTTP service requests in an infinite loop.
              while (true)
                   // Listen for a TCP connection request.
                   // (note: this blocks until connection is made)
                   csocket = ssocket.accept();     
                   // Construct an object to process the HTTP request message.
                   HttpRequest request = new HttpRequest(csocket);
                   // Create a new thread to process the request.
                   Thread thread = new Thread(request);
                   // Start the thread.
                   thread.start();
    final class HttpRequest implements Runnable
         final static String CRLF = "\r\n";
         Socket socket;
         // Constructor
         public HttpRequest(Socket socket) throws Exception
              this.socket = socket;
         // Implement the run() method of the Runnable interface.
         public void run()
              try
                   processRequest();
              catch (Exception e)
                   System.out.println(e);
         private static void sendBytes(FileInputStream fis, OutputStream os)
         throws Exception
            // Construct a 1K buffer to hold bytes on their way to the socket.
            byte[] buffer = new byte[1024];
            int bytes = 0;
           // Copy requested file into the socket's output stream.
           while((bytes = fis.read(buffer)) != -1 ) {
              os.write(buffer, 0, bytes);
              os.flush();
         private static String contentType(String fileName)
              fileName = fileName.toLowerCase();
              if(fileName.endsWith(".htm") || fileName.endsWith(".html")) {
                   return "text/html";
              if(fileName.endsWith(".jpg") || fileName.endsWith(".jpeg") ) {
                   return "image/jpeg";
              if(fileName.endsWith(".gif")) {
                   return "image/gif";
              return "application/octet-stream";
         private void processRequest() throws Exception
              // Get a reference to the socket's input and output streams.
              InputStream is = socket.getInputStream();
              DataOutputStream os = new DataOutputStream(socket.getOutputStream());
              // Set up input stream filters.
              InputStreamReader ir = new InputStreamReader(is);
              BufferedReader br = new BufferedReader(ir);
              // Get the request line of the HTTP request message.
              String requestLine = br.readLine();
              // Display the request line.
              System.out.println();
              System.out.println(requestLine);
              // Get and display the header lines.
              String headerLine = null;
              while ((headerLine = br.readLine()).length() != 0)
                   System.out.println(headerLine);
              // Extract the filename from the request line.
              StringTokenizer tokens = new StringTokenizer(requestLine);
              tokens.nextToken();  // skip over the method, which should be "GET"
              String fileName = tokens.nextToken();
              // Prepend a "." so that file request is within the current directory.
              fileName = "C:\\CSM\\Networking\\Project1" + fileName;
              // Open the requested file.
              FileInputStream fis = null;
              boolean fileExists = true;
              try {
                   fis = new FileInputStream(fileName);
              } catch (FileNotFoundException e) {
              fileExists = false;
              // Construct the response message.
              String statusLine = null;
              String contentTypeLine = null;
              String entityBody = null;
              if (fileExists) {
              statusLine = "200 OK" + CRLF;
              contentTypeLine = "Content-type: " +
                   contentType( fileName ) + CRLF
                   + "Content-length: " + fis.available() + CRLF;
              else {
              statusLine = "404 Not Found" + CRLF;
              contentTypeLine = "Content-type: text/html" + CRLF;
              entityBody = "<HTML>" +
                   "<HEAD><TITLE>Not Found</TITLE></HEAD>" +
                   "<BODY>Not Found</BODY></HTML>";
              // Send the status line.
              os.writeBytes(statusLine);
              System.out.println(statusLine);
              // Send the content type line.
              os.writeBytes(contentTypeLine);
              System.out.println(contentTypeLine);
              // Send a blank line to indicate the end of the header lines.
              os.writeBytes(CRLF);
              // Send the entity body.
              if (fileExists)     
                   sendBytes(fis, os);
                   fis.close();
              // file does not exist
                     else
                   os.writeBytes(entityBody);
              // Close streams and socket.
              os.flush();
              os.close();
              br.close();
              socket.close();
    }

    ok. i figured it out. STUPID mistake. i forgot to include "HTTP/1.1" in my status line!!!

  • Send a picture file using sockets

    Hi,
    Could someone please tell me how I can send a picture file using sockets across a TCP/IP network? I have managed to do it by converting the file into a byte array and then sending it but I dont see the data back at the client when I recieve the file. I just see the byte array as having size 0 at client.
    Byte array size is correct at client side.
    //client code
    System.out.println("Authenticating client");
              localServer = InetAddress.getLocalHost();
              AuthConnection = new Socket(localServer,8189);
              out = new PrintWriter(AuthConnection.getOutputStream());
              InputStream is = AuthConnection.getInputStream();
              System.out.println(is.available());
              byte[] store = new byte[is.available()];
              is.read(store);
         ImageIcon image = new ImageIcon(store);
              JLabel background = new JLabel(image);
              background.setBounds(0, 0, image.getIconWidth(), image.getIconHeight());
              getLayeredPane().add(background, new Integer(Integer.MIN_VALUE));
    //extra code here
              catch (UnknownHostException e) {
    System.err.println("Don't know about host: LocalHost");
    System.exit(1);
              catch (IOException e) {
    System.err.println("Couldn't get I/O for "
    + "the connection to: LocalHost");
    System.exit(1);
    //server code
                   DataOutputStream out = new DataOutputStream(incoming.getOutputStream());
                   FileInputStream fin = new FileInputStream("3trees.gif");
                   byte[] b = new byte[fin.available()];
                   int ret = fin.read(b);
                   out.write(b);

    i used OutputStream as
    OutputStream out = incoming.getOutputStream(); and flushed the stream too.
    But I still get the same output on the client side. I tried sending a string and it works , but I cant seem to be able to populate the byte array on the client side. It keeps showing zero. Please advise.
    Thank you.

  • Get error 66, when try to use TCP vi send string to arduino

    I use TCP vi to send string to arduinos (arduino uno+ arduino wifi shield, and they have arduino code preloaded inside ) wirelessly through the router. Sometimes they can communicate well, the arduino receive the string send by the TCP vi. But sometimes, there will be an error 66 come out of TCP Write vi, so, labview loop will stop. Arduino will say "connection failed". And I have config the VI sever allow the arduino to access.
    Another thing I want to mention is, when I highlight the execution, the error will come out more frequently.

    Actually, they can communicate not only once, sometimes the VI can pass data several rounds, but suddenly the error 66 appears in TCP write, the loop will stop. And if I rerun the program, things happens again. can anybody tell me why the error come out? Thanks

  • Send mail using sockets

    hi everyone,
    has anyone managed to send an e-mail using a socket connection to an smtp on an accompli 008? Sending e-mail using a servlet is possible, but can I send it without servlet?
    any help would be highly appriciated,
    best regards,
    Tom Bemmelmans

    Hi Tom,
    what do you find difficult about SMTP? Here's a hopefully easy recipe:
    - you open a TCP socket and connect with the SMTP server your choice. Port 25.
    - when the connection is established you read off the server's sign-on message
    - you answer by naming your machine, ifff you know the name, otherwise name a dummy name: send the string 'HELO localhost' and append a newline to it.
    - it'll reply with a status line.
    - tell the server you want to send a mail, and who you are. send the string 'mail from: <[email protected]>' and append a newline again
    - it'll reply again
    - tell it the receiver. 'rcpt to: <[email protected]>'
    - it'll ack again
    - tell it you'll send the message now: 'data'
    - it'll tell you to type the message and end it with a line consisting of a '.' by itself
    - type in the message. first write the header. 'date: now' <cr> 'from: me' <cr> 'to: you' <cr> 'subject: blabla' <cr> <cr> 'test12345' <cr> <cr> '.' <cr>
    - it should tell you the messages was submitted and queued.
    You can test just that by connecting to your local SMTP-server on port 25. Mail me if you have problems with that. ;)
    HTH,
    <a href="[email protected]>Thomas Nagel </a>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Sending a File Using DataGram Sockets

    I writting one java program that can be used to transfer a file from one computer to another computer.
    I wrote using Sockets.
    But i want to do that using DatagramSockets. Can we send a file using DataGramSockets?
    Please reply soon.

    You can use DataGram but it is harder.
    One issue is you need to retransmit missing packets. This means you need to keep track of which packets have been sent and be able to send missing ones again.
    If Socket work for you why do you want to use DataGrams

  • Sending a ResultSet using a Socket

    Is it at all possible to send a ResultSet from a Server Application to a Client Application using sockets? I've tried using an ObjectOutputStream but that hasnt helped. Is there anyway to convert the ResultSet to an array and then send the array?
    Any help will be most appreciated.

    Thank you for the help. I've tokenised the information and inserted it into a vector which i hav then sent to the client. Using it as a vector on the client side. I've found out that ResultSet isnt Serializable hence, cant be sent. Could you perhaps point me to any good sites where i can learn to print, fast?
    Thanks again

  • Makepkg fails if upper case md5 strings are used.

    makepkg fails if upper case md5 strings are used. For example
    9e107d9d372bb6826bd81d3542a419d6
    and
    9E107D9D372BB6826BD81D3542A419D6
    for makepkg are not the same thing. Is it a feature or a bug?

    shining wrote:Thanks for reporting the bug : http://bugs.archlinux.org/task/11283
    Please test the patch
    Thanks you.

  • Use Socket to send a File

    I'm looking for the best method to send a Text file to a Mainframe box using sockets, I know that I can do this whit FTP, but I'm trying to get the best way to do it, if anybody can give me an idea I'll appreciate that,
    Thank & Regards

    You'll need to elaborate on your requirements to get the best solution... Otherwise, you'll be hard pressed to find something better than FTP. It's a standardised protocol for file transfer. What more could you want?

Maybe you are looking for