Why do I get this?
Andreas Fransson <[email protected]> Tue, 1 Jul 2003 11:44:04 +0200
| Newsgroups | gmane.comp.java.seda.user |
|---|---|
| Message-ID | <7522E4A26815BA46A6FA6BD9BBBDE4E9040963F5@knant131.europe.ad.flextronics.com> |
Hello fellow SEDA users,
anger grows more and more when I can't figure out why I end up in the wrong
state. I'll put it simple. I try to set up a AUdpSocker for incomming
UDP-packets. No Problemo so far. BUT! When a udp packet arrives to that
socket I dont get a AUdpInPacket as you might think, I get a SinkClosedEvent
instead. Has anyone encountered this or do YOU got the remedy for my
problem. If you're interested, here are parts of my code:
public void init(ConfigDataIF config) {
this.mySink = config.getStage().getSink();
try{
mgr = config.getManager();
sendSink = mgr.getStage("Utskrift").getSink();
}catch (NoSuchStageException e) {
System.err.println("Fel, fel, fel...\nj");
}
listenPort = config.getInt("listenPort");
if (listenPort == -1) {
listenPort = DEFAULT_PORT;
}
try{
sock = new AUdpSocket(listenPort, mySink);
}catch(IOException e) {
System.err.println("Got exception creating serverUDP socket: "+e);
e.printStackTrace();
System.exit(-1);
}
// Start a reader on the UDP socket so we receive UdpInPackets
sock.startReader(mySink);
System.out.println("Init ready---------------------------\n");
}
public void handleEvent(QueueElementIF qel) {
if (qel instanceof AUdpInPacket) {
//Do something funny with the UDP-packet
} else if (qel instanceof SinkDrainedEvent) {
} else if (qel instanceof SinkCloggedEvent) {
} else if (qel instanceof SinkClosedEvent) {
System.out.println("Why do I always end up here???\n");
}
}
-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01