Read/Write to serail port RS232 - java

I am using A software called ASTM protocol Demo to send ASTM messages and another software Virtual Serial Port to use a Port RS232
My question is: I want to create a java project that can access this port and read/write messages from/to this port.

You can use RX/TX.
There is a lot of info on the web about how to use it.
for example.

Related

Why do programs like Skype not require you to open ports?

I'm currently working on a messaging program in java, and I planned on using UDP to send messages from the user to a central server, and I planned on using possibly TCP for messages from the server going back to the user. My main question is, how can I achieve this without requiring the client to port forward?
P2P clients like skype use subtle tricks to connect peers behind firewalls. The different techniques used are outlined here:
http://www.h-online.com/security/features/How-Skype-Co-get-round-firewalls-747197.html
Very simply, the client has to establish the TCP connection to the server, even if the primary (indeed if not only) data flow is in the opposite direction.
Programs like skype either use a common port that is open (port 80) or put a rule in the firewall to allow another port to communicate. Additionally a program can open ports above 1024 without adminisrative permissions although depending on the type of connection it may need to set up UPnP or keep an active channel to a server open.

Identify client in peer to peer filesharing using Java and Corba. And build socket socket between 2 Clients

I am developing a peer to peer file sharing application usig Java and CORBA. I am new to CORBA.
So far I have successfully created a client program that registers a file in the SQL Database via CORBA. The table stores the following information :
filename
Share(Basically, it stores the option of sharing or not sharing the file in the network)
HostName
PortNumber
I am stuck at this point:
How do I find the hostname and portnumber of a client when registering the files to SQL?. Because I believe with the hostname and portnumber, I will be able to build a socket connection between two client programs and therefore start sharing file between peers.
There is at this moment no standardized way to retrieve hostname/portnumber of a CORBA client, the reason is that CORBA is not tied to just sockets, there could be multiple kinds of transports which have completely different ways for addressing. Some ORBs do have some extension to make this possible, for example TAO has a TransportCurrent feature that does give access to this kind of information at the moment the client connects with IIOP. JacORB does have support for org.jacorb.transport.iiop.Current which also looks similar, have a look at that.
But why not use CORBA for the file transfer? Than you don't have to get this information but just can store the stringified object reference and use it at a later moment.

Android Port scanning for TCP server?

I have a TCP server running on a specified port (23232), and an Android app that needs to connect to the IP and Port of this server. Is it possible to obtain the IP by scanning for a port only? I have media player control apps that do this but I have no idea how to implement it.
Thanks in advance.
This is on a local network, correct? I would recommend that you use a multicast service discovery mechanism via UDP, since this is the exact kind of scenario it is intended for. Fixed port, unknown entities on the LAN providing the service.

Java Sockets : Application with both server and client on same machine

I am developing an application to send, receive or update files using Socket, ServerSocket class in Java.
There is one single application which is both server as well as client. I need to get the IP addresses of all other applications running on the same Local Area Network.
How can this be done?
You should use broadcast for this.
For more details take a look here: http://docs.oracle.com/javase/tutorial/networking/datagrams/broadcasting.html

java api to send file through serial port

I want to send a file from my PC to a remote device connected through serial port. So is there any API in java to send file over serial port?
checkout javax.comm
See also RXTX. It is widely used and includes straightforward examples.
There is also JPeripheral.

Categories

Resources