File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -23,14 +23,16 @@ export class Pixelflut {
2323 }
2424 }
2525
26- public createTCPConnection ( ) : Promise < string | void > {
26+ public createTCPConnection ( ) : Promise < string | undefined > {
2727 return new Promise ( ( resolve , reject ) => {
28- let data : string ;
28+ let data : string | undefined ;
2929
3030 this . tcpSocket = new net . Socket ( ) ;
3131
3232 this . tcpSocket
33- . on ( 'data' , bytes => ( data += bytes . toString ( 'utf8' ) ) )
33+ . on ( 'data' , bytes => {
34+ data += bytes . toString ( 'utf8' ) ;
35+ } )
3436 . on ( 'error' , error => {
3537 if ( this . failed ( error . message ) ) {
3638 reject ( error ) ;
@@ -53,10 +55,8 @@ export class Pixelflut {
5355 public createUDPConnection ( ) : Promise < void > {
5456 return new Promise ( ( resolve , reject ) => {
5557 this . udpSocket = dgram . createSocket ( 'udp4' ) ;
56- let data : string ;
5758
5859 this . udpSocket
59- . on ( 'data' , bytes => ( data += bytes . toString ( 'utf8' ) ) )
6060 . on ( 'error' , error => {
6161 if ( this . failed ( error . message ) ) {
6262 reject ( error ) ;
You can’t perform that action at this time.
0 commit comments