Actionscript 3 :: Flex Can't Handle Java Socket Data Quickly Enough?

Oct 26, 2011

I'm sending through a socket from java to flex client some data and the flex side can't seem to handle it right. In the java i'm looping over 8 objects and for each object I create a long string 1:lsls:2:3:justexample then the java does writeToSocket("1:lsls:2:3:justexample") for every iteration of the loop. But in the client side, it seems that only 2 out of the 8 arrived. what can be the problem?

View 1 Replies


Similar Posts:


Flex :: Operator Console App - Listen Java Socket To Receive XML Data?

Jul 13, 2010

We are in the middle to evaluate the technology choice to re-design an operator console application. The operator console as a hosted contact center has the abilities to queue the inactive calls, and hold, answer, transfer the active calls.

The legacy operator console used Java Swing. We want to use the latest RIA technology (Flex/Silverlight) to retire the legacy one. But the question is Flex/Silverlight can implement the functions like hold, transfer the calls? Based on my experiences, Flex can listen Java socket to receive XML data? Does it work well to receive voice data?

View 2 Replies

Actionscript 3 :: Send Data In AMF Format From Flex To Java Socket Server?

May 19, 2011

i want to know how to send data using the AMF format from my flex AIR project to a socket written in Java. I am getting CorruptedStreamException when sending data using writeUTFBytes() methods. Has anyone experienced similar problems? Also can AMF be used only if i am using LCDS only?

private SimpleServer(int port)
{
System.out.println(">> Starting SimpleServer on port " + port);

[code].....

View 2 Replies

Actionscript 3 :: Write Data To Socket Opened By Flex From Java Server

May 19, 2011

Ok, basically my Flex app will open up a socket and listen on it. My java program will write some string to this port.

My AS3 code is

private function onRecvClick():void
{
var host:String = "localhost";

[Code]....

While trying to write to the socket, i am getting this java.net.ConnectException: Connection refused: connect. Funny thing is that the socket in Flex doesn't seem to dispatch any events, is it normal for that to happen?

View 1 Replies

Java :: Handle Custom Java Exception In Flex App?

Mar 18, 2010

we are using BlazeDS as a proxy between Flex and Java. The approach is the same as in

[Code]...

View 3 Replies

Java :: When To Use Socket And When To Use XMLSocket In Flex

May 18, 2011

In what situations should i use Socket class or XMLSocket when trying to connect from Flex to a Java Server that is going to listen to a port?

View 1 Replies

Java :: Read An AMF Object With Flex Socket

May 18, 2011

I'm currently trying to communicate between java and flex by using sockets and AMF serialized objects.

On the java side I use Amf3Input and Amf3Output from BlazeDS (flex-messaging-common.jar and flex-messaging-core.jar).

The connection is correctly established, and if i try to send object from flex to java, i can easily read objects :

FLEX side :

protected function button2_clickHandler(event:MouseEvent):void
{
var tmp:FlexAck = new FlexAck;
tmp.id="123456789123456789123456789";

[Code]....

View 2 Replies

Actionscript 3 :: Communication Between Flex And Java Socket?

May 19, 2011

I have a Flex AIR app, and i am trying to get data from a Java Server. Can some one tell me if this approach will work?

Start a ServerSocket in Java and wait for a connection. Use Flex to connect to the same port. Write some data to the socket from Java Server. Read the data at the Flex end and process it.

I think i am able to get this working, but the data that i read back at Flex end seems to be empty.

My server code is :

socket = new ServerSocket(port);
client = socket.accept();
InetAddress address = client.getInetAddress();

[Code].....

My current problem is socket.bytesAvailable becoming 0 and therefore obj is coming up as "". So how to read data sent from the server using a Socket in Flex?

View 1 Replies

Handle M:M Entity Relationships In Flex / Java Web Application?

Dec 21, 2010

I am struggling to come up with a way to efficiently manage Flex entities that have a many-to-many relationships between their JPA/Java counter parts.[code]Both of these entities can exist independently of each other and both have a 1:M relationship with the other. The relationship is not really owned by one side or the other.Within the application there are Flex UI's that sometimes want to see viewers based on movies and other UI's that want to see movies based on viewers.Currently both the Movies.Viewers and Viewers.Movies collections are lazy loaded by JPA which works fine. The problem is that every time I ask a viewer for it's list of movies, then they all get sent over the wire and then within Flex I end up with a bunch of Movie objects that (often, not always) duplicate the ones I already have there.

It seems inefficient at best and could likely cause errors if the duplicate objects are not dealt with.In my real application I have tons of these types of relationships all over some very large object graphs.It almost seems to me that the lazy loaded object collections need to be turned into eagerly loaded collections of foreign keys which are used to explicitly load objects on the Flex side of things. But this seems like I am writing a JPA provider in Flex! Is the correct answer to never store state in a Flex application? (Yikes)I should add that all my value objects have a UID that is created on the server side, so I could somehow use that to find/remove duplicates on the Flex side. But how?

View 2 Replies

Java :: Binary Socket And Policy File In Flex

May 17, 2010

I'm trying to evaluate whether Flex can access binary sockets. Seems that there's a class calles Socket (flex.net package). The requirement is that Flex will connect to a server serving binary data. It will then subscribe to data and receive the feed which it will interpret and display as a chart. I've never worked with Flex, my experience lies with Java, so everything is new to me. So I'm trying to quickly set something simple up. The Java server expects the following:

DataInputStream in = .....
byte cmd = in.readByte();
int size = in.readByte();
byte[] buf = new byte[size];
in.readFully(buf);
[Code] .....

After that - EOFException happens on the server and that's it. So the question is, am I approaching whole streaming data issue wrong when it comes to Flex? Am I sending the policy file wrong? Unfortunately, I can't seem to find a good solid example of how to do it. It seems to me that Flex can do binary Client-Server application, but I personally lack some basic knowledge when doing it. I'm using Flex 3.5 in IntelliJ IDEA IDE.

View 1 Replies

Java :: Flex Socket - Can't Receive The Command From Server

Aug 20, 2010

I am writing a online game with flex and java server and I have a big problem. In normal case, my game run smoothly but some time the clients can't receive the command from server. I found that if server send message too fast or client is doing something when server send message, the game client can't detect for a new message so my game is freeze. I only tested with 4 clients and I don't know what happen when thousands clients online in the same time. So terrible :(. In the game client, I use one EventDispatcher class to dispatch any command from the server. Do you have any solution to warranty that client must receive any message from server when the connection is still alive or server must know if client received the message or not. I use flex 3 with Socket (binary) and Java QuickServer.

View 1 Replies

Java :: Connecting Android App (with Flex) To Server Using Socket?

Apr 2, 2012

I'm trying to create an app that multiple users would log into a server hosted over the local network. When testing the app in Flash Builder it connects, but when I run it on my phone it does not. I'm using XMLSocket like so:

[Code]....

View 1 Replies

ActionScript 3.0 :: Error With Java+Flex Socket #2048?

Apr 27, 2010

i got a problem with 'Security error',it happens when i try to connect my XMLSocket (Flex) with my Socket (Java)i have a domain:

alucardeck.mine.nu

i startup my apache tomcat 6.0 and in ROOT folder i have:

policyFile.xml and crossdomain.xml

(i had a doubt about what is the correct filename so i created both)both files contains:

<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<allow-access-from domain="*" />
</cross-domain-policy>

well, yes, you can access using the default port 80, as it should be.(but probably my server will be down when u try to access it)so here is what i do: i run my Java server application.there i open 1 socket in port 19809.(i already tried with port 843 too) then, i run my Flex application: [URL]also i tried to run it in ROOT folder..the XMLSocket class is instanced like this:

xmlsock = new XMLSocket();
// add all listeners
Security.loadPolicyFile("http://alucardeck.mine.nu/crossdomain.xml");
// also tried "xmlsocket://alucardeck.m....

[code]....

i also notice when i start my Java Server application with 2 sockets listening ports: 843 and 19809, i notice Flex first try to connect to 843 and then 19809, and in both sockets i reply with that String from before.

View 1 Replies

Java :: Handle Nullable Integer - Flex Remoting Application?

Feb 10, 2011

I have an Application consisting of a Java Server part and a Flash/Flex client, both communicate via BlazeDS. In order to have the same typed Objects on both sites, I use the GAS3 code generator (used by flex-mojos).But now I am facing the problem of handling nullable Integers. The problem is that I have an Object (A) which contains a foreign key ID which is reference an optional Object B. - But I only send the ID to the flex client.On the Java site it is easy:

class A {
private Integer bFk;
getter/setter
}

But on the flex client side, bFk is of type int. And a Flash int can not be null. So the remoting mechanism converts the Java null Integer to 0. After sending it back to the server, the Java bFk becomes 0 even on the Java side. - That is not acceptable, because I need to separate 0 and nullMy first workround is using not a Integer on the Java side, but an new Class NullAbleID, which works a bit like a wrapper/adapter, that wrap an internal int where -1 represent null (I can use -1 for null, because real id will be negative). But when I would using this it means I have to replace all Java Integer ids, by this NullAbleID class.

View 1 Replies

Actionscript 3 :: FLEX - Adding Items To S:list From Recieved Data From Socket

Aug 17, 2011

I have s:list component in my MXML and a different actionsscript file which does the socket connection to the server.Everytime a user is connecting to the server I'm sending to all clients the updated users in the server by sending strings of ports (port for each user).Now, when the data gets to the client (to the action script file SocketData function), I want it to be added as an item to the s:List in the MXML file.

View 2 Replies

Java Socket Server And MySQL

Oct 22, 2011

I'm writing socket server in java for my flash browser based game and i need to connect to mysql database. Is it possible to connect to mysql through socket server and send received data to connected flash clients?

View 1 Replies

Java :: Are Socket's Events Queued In Flash?

Dec 1, 2009

I'm trying to implement a binary protocol between a flash application and a Custom Java Server using TCP/IP sockets, the protocol's messages are of variable length, so my idea is to add a field indicating the number of bytes I have to read before parsing a complete message, something like this:[code]if while processing a message (supossing it is complete) other data arrives through the socket, are messages of type ProgressEvent.SOCKET_DATA queued so the number of times my handler is called is equal (at least in this case) to the number of messages arrived or should I read until all data the socket has available? or simpler: are in general messages for a handler queued in flash?

View 1 Replies

Java :: Connect To Socket Server From AS 3 AIR Application

May 12, 2011

I read through the method to connect to a socket server : [URL]. I wrote an AIR application to connect to the java server code, but the client cannot connect. What is missing in the code?

<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="[URL]"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" backgroundColor="#D5F8C3">
[Code] .....

View 1 Replies

Java :: Handle Multiple Video Streams In Red5?

Apr 15, 2012

I am writing a Red5 application that provides 1-on-1 video chat to a Flash client over RTMP.

Unfortunately most tutorials I was able to find were sketchy at best and the documentation of Red5 itself tends to be vague when it comes to API concepts and intended usage.

In short, I am a bit stuck and looking for hints on Red5 ApplicationAdapter implementation. Gnarly details are as follows:

First of all, the connections come in two flavors: visitors and consultants. A visitor should be able to indicate which consultant it wishes to communicate with. A consultant simply gets connected to the requesting visitor as long as the consultant is not busy servicing another. Obviously, every RTMP connection has two-way traffic: both sending and receiving video. From the standpoint of the server, connections bring in a bunch of video streams that get their receiving endpoints assigned by request. Since several video conversations can be in progress simultaneously, the main task of the application is to handle the mapping of visitor streams to consultants and provide a list indicating each consultant's state (busy/available) via AMF.

So, all in all, I have a pretty good idea what I am aiming for but how to achieve it with Red5 is still a bit of a mystery.

What is the easiest way to establish the connection type (visitor/consultant)? Which API classes should be used to implement a persistent, globally accessible list of active connections for reporting the state of each consultant? How to switch receving endpoints dynamically when the goal is to connect a specific visitor to the selected consultant?

View 1 Replies

Flex :: Actionscript 3 - Flex Socket And Erlang Socket Communication

Jun 29, 2011

I'm creating a client-server game. My client is a flex based game, and my server is erlang server. At the beginning, when I test directly my flex client in flash player, I can establish a connection easily to my erlang server through socket connection. And both can exchange data with no problem. The problem rise when I deploy my flex app at Apache http server, and running it using a browser by calling [URL] my flex socket sends message requesting for a crossdomain policy to my erlang server. So I create an xml message that represent a crossdomain policy, and send it back to my flex app as a response for that request.

Yet still I can't establish any permanent socket connection between my flex client and my erlang server. I know this because I add listener on my flex socket that will modify its internal state to CONNECTED, if a connection between client-server has established.

View 2 Replies

ActionScript 3.0 :: AIR AS3 XmlSocket <=> Java TCP/IP Socket. 00 Byte In Wrong Place?

Mar 8, 2012

I'm extending XMLSocket to work with a daemon, written in Java, that a peer is using to interface with his PLC controller.What I should be seeing from the daemon is simple digital io info in the form:

Code:
d0i,d0o,

Which represents a 'button' dowm/up. The strings are terminated with commas to make it easier for me to parse them. I've got my XMLSocket working just fine, but I'm receiving the data more like this:

Code:
socketDataHandler:
socketDataHandler: D
socketDataHandler: 4

[code]....

So, there's a null character, followed by individual chars that make up the message I'm expecting, only last "," is truncated. It does come through on the next dataEvent:

Code:
socketDataHandler: ,
socketDataHandler: D;
socketDataHandler: 4;
socketDataHandler: O;

Lastly, I checked raw data in a shell, and it looks like:

Code:
0000000: 0044 0034 0049 002c 0044 0034 004f 002c
0000010: 0044 0034 0049 002c 0044 0034 004f 002c

When dumped to hex. It is my understanding (mostly from a sdocs) that Each XML message is a complete XML document, terminated by a zero (0) byte.I can see that he's sending each CHAR separated by a 00 byte, but they are prepended, not appended like:

Code:
0000000: 44 00 34 00 49 00 2c 00 44 00 34 00 4f 00 2c 00
0000010: 44 00 34 00 49 00 2c 00 44 00 34 00 4f 00 2c 00

or even better:

Code:
0000000: 44 34 49 2c 44 34 4f 2c 00
0000010: 44 34 49 2c 44 34 4f 2c 00

View 3 Replies

Java :: View Data From Excel In Flex App?

Apr 4, 2011

I have a flex-application deployed on tomcat with blazeds. User constantly selects ranges excel-document. Now, a user enters a cell addresses in text fields (for example, C1: C20). But it is very inconvenient! How to display excel-data as a table in my application? I think, I can parse excel-document using Apach POI and transmit these data to the Flex-application. But there are other ways?

View 2 Replies

Data Integration :: Handle Double Quotes In Data Read In From External Source?

Mar 14, 2011

I'm trying to read some data in from a sql source, some of which contains double quotes embedded in the text. I know I can strip the doublequotes, but don't want to go that route if I can avoid it. I've tried replacing to double quotes with hex codes before passing the text via parameter to my flash file, but the text string always cuts off at the hex code, the same as if the double quote were present in the string. For example:This is a "text" stringreplace double quotes with hex: This is a x22textx22 stringesults when read into flash: This is a <remainder is dropped>Yet if I type the same text string in a variable in flash, the string displays the double quotes properly:

View 1 Replies

Java :: Data Modeling Tools And Techniques For Flex Web App?

Jun 21, 2009

I'm developing a Flex front end client for a Java server application and I have a set of model classes that represent objects in my business logic and should have the same properties and exhibit the same behaviour throughout all layers. These objects
-Have form validation logic for user input
-Are displayed in various forms (lists, detail views ...) throughout the UI
-Are retrieved from and sent to the server using XML or AMF
-Are validated again on the server
-Are stored in a RDBM with tables and fields corresponding to the classes and fields

This is a very common application structure, I guess. I'm already using:
ORM for the Java backend (Eclipse persistence package)
Automatic mapping from XML to Action Script, using XML schema and the classes in mx.rpc.xml, as described here.
Now, what I'd really like to do is define the objects once (I already have them in XSD) and have tools set up class stubs for the whole chain. What can I use?

I've already heard of (but not evaluated):
XMLBeans to generate Java classes from XML Schema
Granite DS to generate AS classes from Java classes

View 1 Replies

Java :: Check If Data Sent From Flex To Server Is Zipped Or Not

Aug 4, 2010

I want to analyse if the XML I send from my client Flex to my Java using remoteObject is compressed or not. for this, I'm using Wireshark, but it can't get packets in the localhost (windows vista)

View 2 Replies

Java :: Push Data From Service To Flex Clients?

Dec 9, 2010

Since my service, I would like to push data (messaging).

@Service
@RemotingDestination
public class LoginService implements ILoginService
{

[Code]....

With this implementation, nothing to do ... clients receiveid nothing.

So, how I push data from a service like that ? Is it possible ?

View 2 Replies

Java :: Flex 4 Loader Having Status With Data Service

Apr 23, 2011

I have been working on a flex application with java, as i have used Life Cycle Data Service for communication, i wana know, is there any function of flex, where i can see the loading status in percentage, that how much record is being loaded.Problem is, if there is lengthy record, no body comes to know, whats happening with software, like in Comboboxes or Grids, users usually think it as a BUG in application, but ofcourse it is not.I need such graphical loader, which keeps on loading with proper status in percentage, until it receives all data from JAVA (SQL Server).

View 2 Replies

Actionscript 3 :: Not Assigning Data From Java VO To Flex VO Using Cairngorm?

Jan 23, 2012

I have a few values in Java VO, and using cairgorm framework, i had mapping the Java VO to Action script VO in Flex and given same variables name as java Vo variables name. Now the Vo is mapping fine and when looking the result all variables are displaying as null. Can i know the reason for that.Java returning list of VO's.

package com.configuration
{
import com.adobe.cairngorm.vo.IValueObject;

[code]......

View 1 Replies

ActionScript 2.0 :: Make A Policy File For A Socket Server Made On Java With A Client?

Dec 30, 2011

how to make a policy file for a socket server made on java with a client made on as2.

View 21 Replies

Actionscript 3 :: Implement A Data-structure In Flex That Just Like LinkedHashSet In Java?

Aug 17, 2010

As ArrayCollection in Flex is limited, I'm looking for a data-structure that something like LinkedHashSet in Java, LinkedHashSet maintains a doubly-linked list running through all of its entries,it defines the iteration ordering, which is the order in which elements were inserted into the set (insertion-order).But there is little information about Flex data-structure

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved