Re: NullPointerException in Socket
Denis Yakovlev <[email protected]>
| Newsgroups | gmane.comp.hardware.microcontrollers.tini |
|---|---|
| Organization | Plesk.ru |
| Message-ID | <[email protected]> |
Hi,Shawn!!!
Thank you very much for your answer.
But I didn`t forget create ServerSocket at the begin of the programm.
try{
ServerSocket listenSocket= new ServerSocket(SERVER_PORT);
System.out.println("Socket is cool!");
}
catch (IOException excp)
{
System.err.println("Unable to listen port" + SERVER_PORT + ":" +excp);
}
When I run this programm I see - "Socket is cool", but then at point described
above I have NullPointerException.
Have you more ideas?
Excuse me ,but I need any help.
Thanks a lot.
В сообщении от Понедельник 03 Май 2004 21:29 вы написали:
> Hi, Dennis. It looks like you've forgotten to create the ServerSocket
> object:
>
> listenSocket = new ServerSocket(some_port);
>
> Regards,
> -Shawn
>
> On 3-May-04, at 5:46 AM, Denis Yakovlev wrote:
> > Hi, All!
> > Can you help me with folowed problem? May be I just have poor
> > knowledge in
> > Java. So...
> > The problem:
> > public ServerSocket listenSocket ;
> >
> > public void serveTini() {
> > Socket clientSocket;
> > try{
> > System.out.println("Point1");
> > while(keepRunning){
> > System.out.println("DeadPoint");
> > clientSocket = listenSocket.accept();
> > <----
> >
> > at this point I have an error:
> >
> > java.lang.NullPointerException
> > in SockTiniTerm.serveTini(@JPC=b0010)
> > in java.lang.System.???
> >
> > What should I do? Is syntax correct? Anybody please help me
> >
> >
> >
> > --
> > Best regards
> > Denis Yakovlev,
--
Best regards
Denis Yakovlev,
QA Engineer, SW-Soft
Tel:89059564660
_______________________________________________
TINI mailing list
TINI-6tN4nzCoH/[email protected]
To UNSUBSCRIBE, edit your profile, or see list archives:
http://lists.dalsemi.com/mailman/listinfo/tini