Go to Post People in FIRST ARE lucky, because they are living a very creative adventure which just doesn't let up, and that is okay. Who wants to sit there watching TV and being a spectator anyway. - DougHogg [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 03-03-2011, 11:42
Daniel Daniel is offline
Daniel Katanski
#0240
Team Role: Mentor
 
Join Date: Feb 2004
Location: Monroe, MI
Posts: 32
Daniel is on a distinguished road
Need help opening a socket to send data to Classmate running putty.

Attention coding wizards:

My goal is to send diagnostic text to the Classmate to be displayed using putty as a custom/flexible diagnostic display. Here is my code:


import javax.microedition.io.SocketConnection;
import javax.microedition.io.Connector;
import java.io.OutputStream;
import java.io.IOException;


private SocketConnection socket ; // Socket to Classmate
private OutputStream outputStream;


try {
socket = (SocketConnection) Connector.open("telnet://10.36.38.6:23");
socket.setSocketOption(SocketConnection.LINGER, 5);

outputStream = socket.openOutputStream();

System.out.println("Diagnostic socket open.\r\n");

outputStream.write("Goodbye World!\r\n".getBytes());

outputStream.close();

} catch (IOException e) {
System.out.println("Error opening diagnostic socket: " + e.getMessage() + "\r\n");
}


This code gets an error stating "Telnet protocol is not available" (or something similar).

I will try another socket number tonight.

But does anyone have any suggestions how to open a socket or stream to send that to the classmate.

Dan
Reply With Quote
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 08:32.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi