+ All Categories
Home > Documents > proj_rep. proj_re

proj_rep. proj_re

Date post: 04-Jun-2018
Category:
Upload: zaviar
View: 215 times
Download: 0 times
Share this document with a friend

of 13

Transcript
  • 8/14/2019 proj_rep. proj_re

    1/13

    NEUTRON NETWORK LAN MESSENGER

    PROJECT REPORT

  • 8/14/2019 proj_rep. proj_re

    2/13

    NEUTRON NETWORK SERVER AND CLIENT WINDOW

  • 8/14/2019 proj_rep. proj_re

    3/13

    Overview

    Neutron Network LAN Messenger is an easy-to-use LAN messaging application for effectiveintra-office communication. It comes with a variety of handy features such as messagenotification alarms, personal or group messaging, file transfer and an intuitive interface.Absolutely no limitations of si e and type for the files you would like to transfer. A powerfulclient-server easy for maintenance while keeping the setup and other options to an absoluteminimum, re!uiring minimum intervention from an I" staff.

    Introduction

    Soc et

    In computer networking, an Internet socket or network socket is an endpoint of a bidirectionalinter-process communication flow across an Internet #rotocol-based computer network, such asthe Internet."he term Internet sockets is also used as a name for an application programming interface $A#I%for the "'I# protocol stack, usually provided by the operating system. Internet socketsconstitute a mechanism for delivering incoming data packets to the appropriate application

    process or thread, based on a combination of local and remote I# addresses and port numbers.(ach socket is mapped by the operational system to a communicating application process orthread.A socket address is the combination of an I# address $the location of the computer% and a port$which is mapped to the application program process% into a single identity, much like one end ofa telephone connection is between a phone number and a particular e)tension line at thatlocation.

    Soc et !t"te! "nd t#e C$ient%Server &ode$

    &omputer processes that provide application services are called servers, and create sockets onstart up that are in listening state. "hese sockets are waiting for initiatives from client programs.*or a listening " socket, I# Address and the remote port number is re!uired.A " server may serve several clients concurrently, by creating a child process for each clientand establishing a " connection between the child process and the client. +ni!ue dedicatedsockets are created for each connection. "hese are in established state, when a socket-to-socketvirtual connection or virtual circuit $ &%, also known as a " session, is established with theremote socket, providing a duple) byte stream.A server may create several concurrently established " sockets with the same local portnumber and local I# address, each mapped to its own server-child process, serving its own client

    process. "hey are treated as different sockets by the operating system, since the remote socketaddress $the client I# address and'or port number% are different.

  • 8/14/2019 proj_rep. proj_re

    4/13

    Soc et 'ro(r"&&in(

    ocket programming has two parts

    I. erver II. &lient.

    I) Server

    "o start server need to follow some steps, these are

    i. *irst create an I#(nd#oint/e.g. I#(nd#oint ip(nd 0 new I#(nd#oint$I#Address.Any, port%12

    ii. &reate a socket ob3ect./ ocket sock 0 new ocket$Address*amily.InterNetwork, ocket"ype. tream, rotocol"ype.I#%12

    iii. 4ind socket with I#(nd#oint./sock.4ind$ip(nd%12

    iv. #lace socket in Listen mode $to accept call of client%/sock.Listen$ma)&lient5eceived%12

    v. 6hen any call comes from client Accept that call./ ocket client ock 0 sock.Accept$%12

    At that position Accept$% return a new socket to continue communication with called client. 4y

    that socket &lient- erver communication continue.

    "o send some data $in byte array form% to client from server 3ust writeclient ock.send$byteArray7ata%1

    "o receive client data 3ust writeint receivedLen0 client ock.5eceive$client7ata%1

    5eceive$% function reads data in byte array form from client socket and writes to 8client7ata8array, and return integer value how much bytes has received.

  • 8/14/2019 proj_rep. proj_re

    5/13

    II) C$ient

    9ou have to follow 3ust few steps these are

    i. &reate an I#Address ob3ect with erver I# using 7ns.

    I#Address /2ipAddress0 7ns.:et;ostAddresses$?%1

    iii. Now creates a socket ob3ect with three parameter like code.ocket client ock 0 new ocket$Address*amily.InterNetwork, ocket"ype. tream,

    #rotocol"ype.I#%1

    iv. Now create a byte array to send data to server.

    v. *inally send that byte array to server.client ock. end$client7ata%1

    vi. "o receive data from server 3ust wait socket using 5eceive function, when some data received by client socket then it fill a byte array and return a integer value received bytes length.int len 0 client ock.5eceive$server7ata%1

    vii. Now close the client socket.

    Notetrictly speaking, you8re supposed to use shutdown on a socket before you close it. "he

    shutdown is an advisory to the socket at the other end.

  • 8/14/2019 proj_rep. proj_re

    6/13

    A$(orit#&! or De!cri'tion o* &et#od! u!ed in 'ro+ect

    Connection!

    ,) C$ient % Server Connection

    Initially erver is set to listening state. A " socket for server is made alive forlistening.

    &lient is then allowed to make connection with the server. It creates a " client socketand connects to server.

    "here is no limit for number of clients.

    Noti*-in( U!er! w#en " '"rticu$"r U!er Si(n in

    In Neutron Network Messenger, when client is successfully connected to server. All the otheronline users are informed of the arrival of the incoming user at server.

  • 8/14/2019 proj_rep. proj_re

    7/13

    .u$$etin Me!!"(in(

    In Neutron Network Messenger, bulletin messages are sent through server among clients.erver routes the message to different users. If a particular user is online, it receives message at

    once while offline users gets notified when they are signed in. "his type of messaging is very popular in @ffices and @rgani ations. A single piece of information is sent to multiple number ofusers. erver can too send messages to different &lients.

    .u$$etin Me!!"(e Sent.u$$etin Me!!"(e Received

  • 8/14/2019 proj_rep. proj_re

    8/13

    /) Peer to 'eer Connection)

    &lients themselves are connected with peer to peer connections. An additional ocket is reserved for receiving data from other users. A " socket is

    maintained for that purpose. A ocket with a #ort number $ne)t to the one connected toserver% is set to listen state.

    ince all the other clients know the addresses of each other, therefore they can connectamong themselves.

    Another &lient ocket is created when a particular &lient wants to create a peer to peer&onnection with another &lient. "he ender &lient sents a re!uest for peer to peerconnection is accepted by the listener client. (ach time when sender client connects withanother client, a " client socket is created.

    In Neutron Network messenger, this type of connection between two clients is used for thee)change of data in terms of "e)t Messages, #assword #rotected messages and file transfer

    between them.

    Te0t Me!!"(in(

    @nline te)t chat is accomplished using the above peer to peer connection. "wo users cancommunicate with each other for e)change of views.

  • 8/14/2019 proj_rep. proj_re

    9/13

    P"!!word Protected Me!!"(in(

    "his password protected message scheme is used for sending secret messages. No other +ser canread the message without the permission of the receiver. "he message gets viewed only when thereceiver enters his'her account s password successfully. +ser is asked to enter password whenhe'she wants to view the message.

    1i$e Tr"n!*er

    *irst read the file $slice wise% and store a slice data in a buffer $byte array%. It s re!uired

    because " buffer is limited so if we try to send a large data then we will get " buffer overflow error.

    end these buffered data to receiver client using " socket.

    "he temporary buffer then appends the sliced file and merges it into a single file.

  • 8/14/2019 proj_rep. proj_re

    10/13

    Entit- Re$"tion!#i' Di"(r"& 2ERD3

    D"t"4"!e T"4$e!

  • 8/14/2019 proj_rep. proj_re

    11/13

  • 8/14/2019 proj_rep. proj_re

    12/13

    1uture deve$o'e&ent

    In the *uture we will implement the standard techni!ues of messaging i.e. all message e)changeswill be protected by the A( encryption algorithm. oice chat B audio streaming should beimplemented. @ffline messages will be made available to view

    Pr"ctic"$ A''$ic"tion!

    *or most mid-si e companies with networks linking up to >=== computers, this software is theoptimum solution for messaging and files transfer, practically replacing corporate e-mail.*iles transfer $ as attachments %, sending messages to the offline clients and other useful featuressuch as 4ulletin messages, *ast replies and *ast messages.

  • 8/14/2019 proj_rep. proj_re

    13/13

    Re*rence!

    .oo !

    Network #rogramming in .N(" 6ith &C and isual 4asic .N(" 4y *iach 5eid

    &C D.=, "he &omplete 5eference 4y ;erbert childt

    Lin !

    http ''socketprogramming.blogspot.com

    So*tw"re "nd 5"rdw"re Re6uire&ent

    isual &C D==E

    FL server D==>

    Infragistics NetAdvantage D==G

    http://socketprogramming.blogspot.com/http://socketprogramming.blogspot.com/

Recommended